S
shu
Is it legal to declare a static instance of an object compiled in a "No
CLR support" .obj?
I have the next .cpp, in which I mix definition of CTest and declarion
of the static var in the same .cpp to make the example shorter :
class CTest
{
public:
CTest();
~CTest(); // <- Important to reproduce
};
CTest::CTest()
{
}
CTest::~CTest()
{
}
static CTest s_CTest; // Here!!: _CrtIsValidHeapPointer
I also have 2 other additional .cpp in the project: AssemblyInfo.cpp
and Main.cpp, both compiled with the /clr switch.
My problem arises when calling the unmanaged static constructor... it
calls the unmanaged crt _atexit function in order to subscribe the
destructor to the list of functions that get called at program exit,
but it seems like the CRT is not initialized yet!!
Any ideas?
CLR support" .obj?
I have the next .cpp, in which I mix definition of CTest and declarion
of the static var in the same .cpp to make the example shorter :
class CTest
{
public:
CTest();
~CTest(); // <- Important to reproduce
};
CTest::CTest()
{
}
CTest::~CTest()
{
}
static CTest s_CTest; // Here!!: _CrtIsValidHeapPointer
I also have 2 other additional .cpp in the project: AssemblyInfo.cpp
and Main.cpp, both compiled with the /clr switch.
My problem arises when calling the unmanaged static constructor... it
calls the unmanaged crt _atexit function in order to subscribe the
destructor to the list of functions that get called at program exit,
but it seems like the CRT is not initialized yet!!
Any ideas?