请问model对话框一modal就正常退出了是什么原因?
我就这一个modal对话框,在app里面调用:
CXXXDlg dlg;
m_pMainWnd = &dlg;int nResponse = dlg.DoModal();
if (nResponse == IDOK)
...
else if (nResponse == IDCANCEL)
...
我跟踪的时候发现nResponse即不等于IDOK也不等于IDCANCEL.DoModal的时候马上就返回退出了。Debug框里面显示的也是has exited with code 0(0x0).
我就这一个modal对话框,在app里面调用:
CXXXDlg dlg;
m_pMainWnd = &dlg;int nResponse = dlg.DoModal();
if (nResponse == IDOK)
...
else if (nResponse == IDCANCEL)
...
我跟踪的时候发现nResponse即不等于IDOK也不等于IDCANCEL.DoModal的时候马上就返回退出了。Debug框里面显示的也是has exited with code 0(0x0).
而且CXXXDlg结束时应以EndDialog(IDOK)和EndDialog(IDCANCEL)结束,
然后在APP中判断就应该可以了!