新建一个AppWizard项目,就有一个资源ID为IDD_ABOUTBOX的对话模板代码如下:
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
CDialog dlg(IDD_ABOUTBOX);
int nResult=dlg.Domodal();
CString str;
if(IDOK==nResult)
{
str=_T(" OK ");
}
else if (IDCANCEL == nResult)
{
str=_T("CANCEL");
}
else
{
str=_T("Unknown value");
}
AfxMessageBox(str);
}
调试是时候有如下的错误。
Compiling...
AddressBookDlg.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\AddressBook\AddressBookDlg.cpp(45) : error C2039: 'Domodal' : is not a member of 'CDialog'
        c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2568) : see declaration of 'CDialog'
Error executing cl.exe.AddressBook.exe - 1 error(s), 0 warning(s)
他说'Domodal' : is not a member of 'CDialog' ,可书上明明说调用CDialog::DoModal(),就可以显示对话框,请解释一下是怎么回事?先谢谢了