基于非模态对话框的MFC工程#
BOOL CMyApp::InitInstance()
{
//……
CMyDlg * pDlg=new CMyDlg;
m_pMainWnd = pDlg;
return pDlg->Create();
}
void CMyDlg ::OnClose()
{
if (CanExit())
{
DestroyWindow();
delete this;
AfxPostQuitMessage(0);
}
}
VC编程经验总结第一版完成
限制应用程序的实例数目