Jump to content
  • Advertisement
Sign in to follow this  
bartiss

Werid String behaviour through a DLL

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

Hi, I have a following problem (not occuring in Release setup): There is a Debug built DLL using a following function declared as: void setExternalTextureSource( const String& sTexturePlugInType, ExternalTextureSource* pTextureSystem ); when my dll calls it (while app is loading it) like this: ExternalTextureSourceManager::getSingleton().setExternalTextureSource("wmvideo", pTextureSource); I get exception because parameter sTexturePlugInType="ĘĘĘĘwmvideo" (at least my debugger says so) and since this string is corrupted it fails to add to another string and crashes. What can cause such a thing? I tried different types of strings and it didn't help. The only improvement is passing char* instead of String&. The text is not corrupted but the dll crashes later anyway. This doesn't occur when in Release mode. I compile my app under VC7.1, Ogre from source under VC7.1 and this dll under VC8 (since VC7.1 fails to compile it). Any kind of hint is more than welcome :) [Edited by - bartiss on October 30, 2007 3:25:21 AM]

Share this post


Link to post
Share on other sites
Advertisement
I can't compile the plugin with VC7.1 since it generated compiler errors like: "dll_import not allowed" or something like that I don't remeber exactly.

The dll code is downloaded along with project script for VC8. I tried forcing VC7.1 to use the same settings by manually looking to VC8 script and identifying appropriate settings, but it didn't help :/

My app project is written under VC7.1 and I really don't feel like adapting it to VC8. I know it'll get converted but it won't compile right I'm sure of it and... VC8 works kind of slow on my machine.

Share this post


Link to post
Share on other sites
Is String a typedef for std::string, by any chance? You can't share STL objects between different STL implementations, since the objects can have different memory layouts in different STL versions. The only real way around this is to recompile the DLL, or switch to the same version of the STL (And probably compiler in that case) as the DLL was built with.

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!