class CMyDlg { ... bool display;};CMyDlg::CMyDlg { display =true; if(MB_OK ==MessageBox(_T("MessageBox Show!"))display =false;} int CMyDlg::DoModal() { // TODO: Add your specialized code here and/or call the base class if(!display)return IDCANCEL; return CDialog::DoModal(); }大概这么着吧。
{
MessageBox(_T("MessageBox Show!"));
exit(0);
}
{
//Close();
//PostMessage(WM_CLOSE);
//OnOk();
//OnCancle();
}
{
...
bool display;};CMyDlg::CMyDlg
{
display =true;
if(MB_OK ==MessageBox(_T("MessageBox Show!"))display =false;}
int CMyDlg::DoModal()
{
// TODO: Add your specialized code here and/or call the base class
if(!display)return IDCANCEL;
return CDialog::DoModal();
}大概这么着吧。