static void DeInitManagedModule() { //Deinit the entity plugin directly since we link statically to it GetEnginePlugin_NodeEnginePlugin()->DeInitEnginePlugin(); #if (_MSC_VER < 1400) //pre MSVC 8.0 // Microsoft Knowledge Base 814472 __crt_dll_terminate(); #endif }
BOOL ManagedWrapper::mterminate (void) { BOOL retval = TRUE; try { retval = __crt_dll_terminate(); } catch(System::Exception* e) { Console::WriteLine(e->Message); retval = FALSE; } return retval; }
extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt) { switch(msg) { // onload of arx case AcRx::kInitAppMsg: { acrxDynamicLinker->registerAppMDIAware(pkt); // we add code that will use global variables or native classes with // static data members (for example, the ATL, MFC, and CRT libraries use global variables) // once we do this we will receive linker error messages at compile time. // To get round this problem, we must add code to manually initialize the static variables // see http://support.microsoft.com/?id=814472 for more details __crt_dll_initialize(); // create a new object factory array static AcMgObjectFactoryBase* PEs[] = { new AcMgObjectFactory<Autodesk::ObjectDbxSample::Poly,AsdkPoly>(), // end the array with a NULL NULL }; g_PEs = PEs; }break; case AcRx::kPreQuitMsg: { // clean up int i=0; while (g_PEs[i]!=NULL) delete g_PEs[i++]; // use atexit. // see http://support.microsoft.com/?id=814472 __crt_dll_terminate(); }break; } return AcRx::kRetOK; }