DoModal()问题
好人吗 2012-09-07 03:58:17 下面的代码是CWinApp的InitInstance函数的代码
CTxtDlg dlg; //系统生成的Dialog
CSQLITE3 sqlite;
CString strPath;
strPath.LoadString(IDS_SQLITEPATH);
sqlite.OpenDB(strPath);
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
CMainDlg maindlg; //自己添加的Dialog
m_pMainWnd=&maindlg;
int nMain=maindlg.DoModal(); //为什么DoModal()不起作用?
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}