Help with switching to module state (DLL)
-
I have been working on a DLL w/ a basic CDialog. At this point, my dialog can be loaded with my testerApp and appears to work (can drag arround click buttons etc), but there appears to be something odd going on when switching to the module state. When the my dll's CWinApp::InitInstance() is called, this is 0x101c8640. In calls to the dll's exported funcs this is 0x0012fdac (the same as my tester app). Any ideas on what I am doing wrong?
BOOL CWM_Script_DLLApp::InitInstance() { CWinApp::InitInstance(); dlg = NULL; return TRUE; } extern "C" void CWM_Script_DLLApp::createDialog(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState( )) if(dlg == NULL){ dlg = new CTestDlg(CWnd::GetDesktopWindow(),this); //pass this so dlg can be set to null on close dlg->Create(CTestDlg::IDD); dlg->ShowWindow(SW_SHOW); } else{ dlg->SetActiveWindow(); } } void CWM_Script_DLLApp::killTestDlg(void) { dlg = NULL; }