Jump to content
  • Advertisement
Sign in to follow this  
Crypter

String gets currupt

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

This is a weird bug... As some of you may know, Im developing a demo for our engine. This demo is completely standalone using the engines library files and *.dlls. With the demo (It is an EXE), I link it with my engines LIB files, and I call the DLL's routines. Everything is okay, until I create the renderer:
	std::string str="OpenGL";
	pCore->CreateRenderDevice (str);
pCore is of type "Core", defined in the engines *.dll. I can call functions just fine (I know because I am able to initiliaze it), but this one routine is failing. The above code gives me an access violation exception. the weird thing is that, if I comment out the declaration of the "str" varable (if I just have this):
	pCore->CreateRenderDevice ("OpenGL");
I get a currupt string " GL éY(D áîG ♠" Any suggestions? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I should probably add that Im not using my engines memory manager, so I
dont/hope its not memory currption (Dont see how its possible)

Thanks again for any suggestions.

Share this post


Link to post
Share on other sites
Are you running debug or release?

It's not the string thats causing a problem, that much seems clear. I hope CreateRenderDevice doesn't take a char *. What's it take as parameters and what does CreateRenderDevice do with it?

Share this post


Link to post
Share on other sites
debug build (With the engines debug libs and DLLs)

Here is a part of the routine (I added the MessageBox for test output):

Video::VideoDriver* Core::CreateRenderDevice ( const std::string& strDevice ) {

// This is the first thing executed in this function:
MessageBox (0,strDevice.c_str(),"***TEST***",MB_TOPMOST|MB_OK);

// etc...
}

When I call the routine like so:

// std::string str="OpenGL";
pCore->CreateRenderDevice ("OpenGL");

The MessageBox routine displays only "GL". My log output displays
" GL ╫Y(D áîG ♠ "

The full declaration:

class EVEH_API Core {
public:

// etc etc...

Video::VideoDriver* EVEHCALL CreateRenderDevice ( _in const std::string& strDevice );

// etc etc...
};


The entire routine is fairly complex, so I rather not post it here,
unless I need to. Nontheless, I made "MessageBox" the very *First*
thing in the routine, and it itself fails.

Any suggestions?

Share this post


Link to post
Share on other sites
Are both the .exe and the .dlls built the same way? I mean, using the same compiler and same configuration(debug/release)? If not, that may be the problem.

Share this post


Link to post
Share on other sites
Same compilier IDE, but completely different workspaces/projects.
Im going to check configuation settings right now (I didnt think of that)...

They are both debug builds though.

Share this post


Link to post
Share on other sites
I changed the runtime library from "Multithreaded" to "Multithreaded debug",
and its working now [smile]

Thanks alot!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!