Jump to content
  • Advertisement
Sign in to follow this  
AshleysBrain

(MFC) CString crash crossing DLL boundary

This topic is 4353 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

I've got a strange problem with CStrings. I'm designing an SDK for my application. At one point the SDK assigns a string literal to an empty CString in the main application via a pointer (so the DLL is accessing a CString in a different module). Since the CString is previously empty, I'm assuming it reallocates. However it crashes in Release mode (but not debug). I've identified the problem as CString assignment with messagebox popups :P All structs/definitions are identical as are calling conventions and linker settings in both compiles. Both are set to "Use MFC in a shared DLL", and both link to "Multithreaded DLL" CRT library (obviously Debug Multithreaded DLL for the working debug build though). I've heard about problems with heap allocations over DLL boundries but my linker settings are the same and I can't see the problem. I can and probably should abstract out CStrings for portability, but can anyone shed any light on the issue?

Share this post


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