Hi!
i have this tiny engine of mine, at it was a set of *.cpp files, each containing some class, i used them like this:
//at top
#include "cBaseClass.h"
cBaseClass* g_pBase=NULL;
//in main()
g_pBase = new cBaseClass();
//at the end
SAFEDELETE(g_pBase);
and it all worked fine, no matter hom crappy solution that is
now, i want to convert my engine to one,big dll file, so i made this:
/////////////////////////in dll.cpp
#include "cBase.h"
cBase::cBase()
{
//etc....
}
///////////////////////////in dll.h
#ifdef LIB_EXP
#define LIB_API __declspec(dllexport)
#else
#define LIB_API __declspec(dllimport)
#endif
class LIB_API cBase
{
public:
cLog();
};
the problem is, that when i compile the exec with this lib, and use the same pointer_class->thing like in the first example i get debug assertion failure on some HeapChecking routine.
I figure it out, that the problem is related to the fact that the class is new''ed in dll''s heap and deleted''ed in exe''s heap
hmmm, i always thought that this is the same heap...whatever...
i also tried all the combinations with CRT lib (MultiThreaded,Dll,etc....) so this isn''t my problem...i''ve just run out of ideas
please help....