Hi, my problems deals with native C++ DLLs (Visual Studio 2005, if it matters) and how to write them in order to insure that:
- when the DLL is compiled in release mode, it will be correctly loaded by an EXE compiled in release or debug mode (first priority)
- when the DLL is compiled in debug mode, it will be correctly loaded by an EXE compiled in debug mode too.
Today I have a C++ native DLL that loads and works fine in DLL-release/EXE-release mode. The DLL loads but doesn't work fine (function calls return unexpected results) in DLL-release/EXE-release mode (and this is a huge problem, because it prevents me from debugging the EXE, which is my main goal) and crashes on a heap corruption in DLL-debug/EXE-debug mode.
I know that there is a CRT-related problem that requires CRT-isolation between DLL and EXE. Normally this problem is solved by making operators new/new[]/delete/delete[] private in the DLL and wrapping them by create()/release() functions that allows to the EXE dynamic object creation.
My question is: before I start re-factoring all my code in that direction, is there something else I need to do in order to avoid these kind of problems ? CRT-isolation will probably fix my DLL-debug/EXE-debug crash, but I'm not sure it will fix the DLL-release/EXE-debug problem.
Any hint ? Anyone having already been confronted to this problem ?
Thanks, Al.