Archived

This topic is now archived and is closed to further replies.

Zidane

Debug Heap Assert Failure ? O_o

Recommended Posts

Ok this has been confusing \ annoying me for about 4 hours today and i have tried a lot things to get to the source and fix the error, and i would apreciate any insights you guys can give me Firstly an overview of the error itself: An engine class called CEdenEngine located in engine.dll has a method called Initalise which takes a pointer to a configuration structure - now this structure can come from two places - the user and a method in the class which reads the config data from a file and places it into a structure before passing the address of this structure to the method in question. Now the line below - or more like the method the line below calls generates this weird debug heap assert failure pDriver->GetWindow()->SetWindowCaption(pEdenSettings_->m_AppName); now pDriver is a class which is created by calling a method in a seperate dll which is load dynamically at runtime - (pDriver uses a shared interface which both the engine and the driver know about). The code above gets a pointer to the window created by the driver and calls it setwindowcaption method which takes a constant std::string. In this case it is m_AppName a member of the configuration structure passed to the function. Below is the implementation of the SetWindowCaption function EdenBool CWindowImp::SetWindowCaption(const std::string c_FileName_) { ::SetWindowText(hwnd, c_FileName_.c_str()); return(true); } now i cant see anything wrong with this code - but here is a twist. If i change the calling line to anything that creates a std string, like such: pDriver->GetWindow()->SetWindowCaption("KoRn are cool"); there is no exception. Any ideas what cold be going wrong? is the fact that the setwindowcaption function in a seperate dll releven? is some pointer going out of scope or something?

Share this post


Link to post
Share on other sites
Today''s DLL question is once again probably solved by setting your runtime library to debug multithreaded DLL across the entire solution. Reason: one heap across all DLLs.

This should be in the FAQ. Its occured pretty much every day in one form or another for the past week.

Share this post


Link to post
Share on other sites