Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

mfc dll crash

$
0
0
a MFC dll using ActiveX control, consider the case when the content of Start() is uncommented, and within OpenDialog(), AFX_MANAGE_STATE(AfxGetStaticModuleState( )); is commented. In this case the MFC dll crashes when executing the dlg.DoModal();. Otherwise it works ok. not certain why?.Start() is called first. :confused:

Code:

BOOL CQBDllApp::InitInstance()
{
        AfxOleInit();
        AfxEnableControlContainer();
        CoInitialize(NULL);

        return CWinApp::InitInstance();
}

void CQBClass::Start()
{
        //AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
}

void CQBClass::OpenDialog()
{
        AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
        dlg.DoModal();
}


Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images