int CServerApp::ExitInstance()
{
// TODO: Add your specialized code here and/or call the base class
MessageBox(NULL, "UnInit", "Message", MB_OK);
CServerDlg SerDlg;
SerDlg.m_NetSvr.UnInit();
CoUninitialize();
return CWinApp::ExitInstance();
}为什么关闭程序前没有出来信息框?
{
// TODO: Add your specialized code here and/or call the base class
MessageBox(NULL, "UnInit", "Message", MB_OK);
CServerDlg SerDlg;
SerDlg.m_NetSvr.UnInit();
CoUninitialize();
return CWinApp::ExitInstance();
}为什么关闭程序前没有出来信息框?
看了这篇文章,你就知道原因了。http://support.microsoft.com/kb/253130/en-us解决方案就是在Initinstance中将 m_pMainWnd = &dlg;这句注释掉。
{
// TODO: Add your specialized code here and/or call the base class AfxMessageBox("222");
return CWinApp::ExitInstance();
}
支持4楼哥们的说法
解决方案就是在Initinstance中将 m_pMainWnd = &dlg;这句注释掉。这种方法我的程序运行时崩溃AfxMessageBox("222"); 这种方法也没反应谢谢大家的回复虽然没解决,但也学到点,现给分了
因为AfxMessageBox和你的MessageBox调用原理是一样的。
4楼和6楼说MessageBox不能被调用,可能是他们没注意到你的程序调用的不是CWnd类的内置MessageBox函数,而是sdk中MessageBox函数。
至于为什么会崩溃,microsoft网站上并没有说,不过问题应该不难解决,你可以帖出程序崩溃在何处,我可以帮你解决。