I am working on a library that support multiple programming environment such as VB6 and FoxPro. I have to stick with C convention as it is the lowest common denominator. Now I have a question regarding the style.
Suppose that the function process input and returns a string. During the process, the error can happen. The current proposed ...
I would like to move the Visual Studio solution (myProject.sln) file into a folder.
The problem with doing this is that all the relative paths in the project will break, how can you relocate the project without updating all relative paths inside the project manually?
Thanks.
...
I have a one-function DLL that exports GetHash(). However, the source code for this DLL is lost. I need to integrate this code into my MSVC++ project.
I know that there are some shareware tools for doing this, but I think that I can do it manually.
What do I need to do, to accomplish this manually?
...
I'm aware of the "Enable just my code" debug option, but that only works for managed code.
I'm looking for a way to step into a function call without having to step through, for example, an STL string cast operator because there is an implicit conversion from a char* to a string in one of the function's parameters.
...
Can anybody translate the following code to C++? Is this possible at all or are there vital information missing?
Dim Laser As Object
Sub EnableLaser
‘ Create a laser object if it hasn’t been done yet
If Laser Is Nothing Then
Set Laser = CreateObject("NWLaserXControl.NWLaserX")
End If
If Laser.Initialize Then
...
Having experienced the horror that is Oracle Pro*C, when dealing with dynamically specified columns, and the need for bulk operations (ANSI METHOD 4), I simply must ask:
What Ideas/Techniques can you share which makes it easier to develop/test/debug/maintain C and C++ CRUD applications which use Pro*C or Pro*C++? I am specifically int...
Is there any simple Win32 API to check whether a pointer points to a valid memory location before using it for write operation?
...
__int64 i64FreeBytes
unsigned __int64 lpFreeBytesAvailableToCaller,
lpTotalNumberOfBytes,
lpTotalNumberOfFreeBytes; // variables used to obtain
// the free space on the drive
GetDiskFreeSpaceEx (Manager.capDir,
(PULARGE_INTEGER)&lpFreeBytesAvailableToCaller,
...
I have a custom CTabCtrl which I am trying to customize (to automatically change pages).
If I handle ON_NOTIFY_REFLECT(TCN_SELCHANGE, ...) in my tab control, ON_NOTIFY(TCN_SELCHANGE, ...) is not received by the parent class.
How can I receive both notify messages in the child and parent classes?
Currently I am using a "workaround" of...
We have some projects that have CPPUnit tests that are build and run using an ant script to build them all (right now we're using Borland C++, but we're moving to VS2008).
The problem is that the interface to run and see the result of tests is unpleasant (command prompt). It would be awesome to have them run inside eclipse or VS2008.
I...
I'm trying to send a COM object over a MSMQ message in C++. This is my object :
class ATL_NO_VTABLE CAnalisis :
public CComObjectRootEx,
public CComCoClass,
public ISupportErrorInfo,
public IDispatchImpl,
public IPersistStreamInit
{
private:
typedef struct {
DOUBLE size;
float color;
float light;
...
I am not quite clear if auto_ptr will help me in this case:
class A
{
A(const B& member)
: _member(B)
{};
...
const B& _member;
};
A generateA() {
auto_ptr<B> smart(new B());
A myA(*smart);
return myA;
}
Will the myA._member reference be valid when smart leaves its enclosing scope? If auto_ptr isn't the answer her...
I have a service, say foo, written in C++, that runs as root. There is the usual scrip, /etc/init.d/foo start|stop|restart.
At certain times, foo needs to reload itself. Normally after an upgrade has finished. But doing things like:
system("/etc/init.d/foo restart")
doesn't work since as soon as restart kills foo, the system() cal...
I was wondering if anyone could spot what is wrong with my structure declaration and use. At the moment I have a structure and wish to store float array as one of it's members.
My code:
struct Player{
float x[12];
float y[12];
float red,green,blue;
float r_leg, l_leg;
int poly[3];
bool up,down;
};
I then tried filling the struct:
f...
I've had a hard time finding references in the TR1 documentation concerning shared arrays. The Boost documentation is fairly clear that there is a significant difference between the C++ "new" and "new[]" expressions. The shared_ptr template is meant to correctly hold a pointer to a dynamically allocated objected created using "new". T...
I've been browsing around c++ and I found a link to:
Barton-Nackman trick
Curiously recurring template pattern
I'm wondering is there some sort of master list of these tricks? I'm trying to improve my skills.
...
Hello,
I am getting this error
error: Access.Core may be used uninitialized in this function
And this is my code:
static int FirstTime = 1;
MyStruct Access;
if (FirstTime) {
FirstTime = 0;
Access = Implementation();
DoSomething(Access);
}
if(Other_Variable) {
Access = Implementation2();
DoSomething(Access);
...
Does the ANSI standard mandate logic operators to be short-circuited, in either C or C++?
I'm confused for I recall the K&R book saying your code shouldn't depend on these operations being short circuited, for they may not. Could someone please point out where in the standard it's said logic ops are always short-circuited? I'm mostly in...
I have created a small daemon (basically a console application that hides the console and runs).
I need to send it to a user and have tried renaming the executable with a different extension, emailing it to the user, and having them rename it to the correct name.
This seems to work when I email it to myself to test it. However, when ...
Hello stackoverflowers :)
I am in need of a performance-oriented hash function implementation in C++ for a hash table that I will be coding. I looked around already and only found questions asking what's a good hash function "in general". I've considered CRC32 (but where to find good implementation?) and a few cryptography algorithms. M...