Jump to content
  • Advertisement
Sign in to follow this  
Tree Penguin

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

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!