MSVC++ - Pointer problems between different DLLs (Release Mode only)??

Started by
1 comment, last by Tree Penguin 18 years, 11 months ago
Ok, i have this simple piece of code which always worked fine and now doesn't anymore: // In game.exe: rv=modHandleCommand(inpline); // In mod.dll: MODDLL int modHandleCommand(unsigned char *cmd){ // Do things with cmd } Inpline is a valid pointer but cmd is a bat pointer. Am i doing something wrong?? I've tried deleting all files except libraries (which i think can´t be the problem), source files and the solution file and rebuilded it but still it doesn't work. What can be the problem?? Any help is very much appreaciated!!! EDIT: The problem only occurs in release mode, in both modes inpline is valid but in release mode the cmd pointer is always a bad ptr.
Advertisement
Make sure the settings for your release build are relatively the same as the settings for your debug build. For instance, if your debug build is set to be built as a multi-threaded DLL, make sure your release build is also. Settings are usually, in my experience, the reason a release-built DLL project fails to work where a debug-built project did not.

If the problem is something else, it may be too difficult to determine unless we seem some more specific code.

I hope that helps.
The settings are the defaults (except the output directories) and i checked them double to make sure everything was right and it was. I don't think any more code is needed than i already posted, the fact is that i try to pass a pointer to a function in a library as an argument, when i pass it it´s valid and when the function recieves it it isn't anymore.

I'll try deleting all project files and all other non-source files and see if that works.

This topic is closed to new replies.

Advertisement