MFC中窗口的弹出,小弟新手
我是用MFC的基本对话框来做程序的,想要在登录窗口输入账号密码点击确认后,弹出主窗口,但每次输完点击后程序都直接关掉,下面是 CShangweijiAPP中INit**中我所写的代码,希望高手指教CDengLu dlg;
m_pMainWnd = &dlg;//程序运行首先启动登陆窗口
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
CShangweijiDlg zhu_dlg;//单击确定后出现程序主窗口
zhu_dlg.DoModal();
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;