不明白啊不明白
不明白啊不明白
在一个类MyShape.h中如下定义:public CString m_strFileName;
在MyShape.cpp中有如下语句:
CFile file;
CFileException e;
char szFilter[]="shp(*.shp)\0*.shp\0All Files(*.*)\0*.*\0\0";
CFileDialog OpenDialog(TRUE);
OpenDialog.m_ofn.lpstrFilter=(LPSTR)szFilter;
if(OpenDialog.DoModal()==IDOK)
{
m_strPathName=OpenDialog.GetPathName();
return TRUE;
}
else
return FALSE;
运行到m_strPathName=OpenDialog.GetPathName();此句时报错。
唉。why,why??