出错了不知如何解决,谁来帮帮我~~明天就得交了。谢谢哥哥们

void CHomeworkDlg::OnButton3() //打开数据按钮设置
{
// TODO: Add your control notification handler code here
renew();
drawtype=1;
CString strf;
strf="Txt Files(*.txt)|*.txt||";
CFileDialog dlg(true,NULL,NULL,OFN_EXPLORER|OFN_HIDEREADONLY|OFN_ENABLESIZING|OFN_FILEMUSTEXIST,strf);
dlg.m_ofn.lStructSize =sizeof(OPENFILENAME);
if(dlg.DoModal==IDOK)
{
strDirFile=dlg.GetPathName();
}
CWnd::UpdateData(false);
CFile file(strDirFile,CFile::modeReadWrite|CFile::shareExclusive);
CArchive ar(&file,CArchive::load);
CWnd::UpdateData(true);
while (num {
ar>>filedata[num];
data[num]=(float)(atof(LPCTSTR(filedata[num])));
CWnd::UpdateData(true);

    报错说 E:\编程\homework\homeworkDlg.cpp(228) : error C2446: '==' : no conversion from 'const int' to 'int (__thiscall CFileDialog::*)(void)'
    There are no conversions from integral values to pointer-to-member values
            :\编程\homework\homeworkDlg.cpp(228) : error C2040: '==' : 'int (__thiscall CFileDialog::*)(void)' differs in levels of indirection from 'const int'

1个回答

if(dlg.DoModal==IDOK)
->
if(dlg.DoModal()==IDOK)

caozhy
回答这么多问题就耍赖把我的积分一笔勾销了 回复DX231: 麻烦点下我回答右边的采纳,谢谢
4 年多之前 回复
DX231
DX231 谢谢!好棒
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐