i'm sure the whole stl being used in a dll thing has been discussed a lot already, but i always seem to have 1 specific problem, as demonstrated by this code:
the problem is, that there is a debug assertion failed error on expression _CrtIsValidHeapPointer(pUserData) at runtime, when the main function returns. i'm fairly sure it occurs when the std::string goes out of scope, since i've had similar problems before.
std:string is a template STL class so I'm you're probably experiencing the same sorts of problems.
Requests such as
"I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.
can u post your test project, I'll look at it with some diagnostice software I have here.
Requests such as
"I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.
Requests such as
"I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.
i'm sure the whole stl being used in a dll thing has been discussed a lot already,
I guess you missed the many discussions that both the app and DLL must use the DLL version of the runtime library. The reason why is that classes that allocate memory internally in one module must use the same heap manager when deallocating in another module. Only the DLL runtime library ensures this.
Also another issue with what you're doing is that you will get in a lot of trouble with your application if the app uses a different version of the string class as the DLL. In other words, your DLL will only work with an app created with the exact same version and service pack build of Visual C++ as the DLL was created with. For example, if you created the DLL with the stock version of Visual C++, and I create an app that uses the Visual C++ STLPort version of the STL classes, your DLL cannot be used by my application.
Because I had similar problems I ended up writing my own map, array classes to manage void pointers and then wrapped these basic classes in a class specific to each object type.
Last edited by Bob Sheep; July 21st, 2005 at 07:52 AM.
Requests such as
"I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.