为什么我加上以上代码后编译出错. MainFrm.cpp D:\book\hello\MainFrm.cpp(267) : error C2228: left of '.DoModal' must have class/struct/union type D:\book\hello\MainFrm.cpp(268) : warning C4390: ';' : empty controlled statement found; is this the intent? D:\book\hello\MainFrm.cpp(268) : error C2228: left of '.GetPathName' must have class/struct/union type Generating Code... Error executing cl.exe.hello.exe - 2 error(s), 1 warning(s)
dlg.DoModal();
CFileDialog dlg(true,NULL,NULL,OFN_HIDEREADONLY,szFileters);
if(dlg.DoModal()==IDOK)
this->m_strPath=dlg.GetPathName();//保存选择的文件的路径
UpdateData(false);
CString strFilePath;
if(dlg.DoModal()==IDOK)
strFilePath=dlg.GetPathName();
CFileDialog filedlg(FALSE);
filedlg.DoModal();
CFileDialog fdlg(TRUE,NULL, NULL, OFN_HIDEREADONLY| OFN_OVERWRITEPROMPT,
"DBS files (*.dbs)|*.DBS|View files(*.view)|*.VIEW|all files (*.*)|*.*||" , NULL);
if( fdlg.DoModal()==IDOK )
{
strcpy( m_fileName, (char*)(LPCTSTR)(fdlg.GetPathName()) ); // 获得文件名
m_fhd = fopen(m_fileName,"r+b"); // 打开文件
}
MainFrm.cpp
D:\book\hello\MainFrm.cpp(267) : error C2228: left of '.DoModal' must have class/struct/union type
D:\book\hello\MainFrm.cpp(268) : warning C4390: ';' : empty controlled statement found; is this the intent?
D:\book\hello\MainFrm.cpp(268) : error C2228: left of '.GetPathName' must have class/struct/union type
Generating Code...
Error executing cl.exe.hello.exe - 2 error(s), 1 warning(s)