MessageBox在公共类的静态函数里为什么不能用?
我MFC里建了个MFC类 目的是放些 静态变量 静态函数什么的,可是这个read函数有错误,我找不出在哪,反正程序总是终止,还有一个MessageBox为什么说“非静态成员引用必须与特定对象相对啊”
void CPublic::read(char* local)
{
MessageBox((CString)"OK");
//LPCTSTR str1=(LPCTSTR)(LPTSTR)local;
CPublic::str.Empty();
CStdioFile myFile;
CFileException fileException;
if(myFile.Open((LPCTSTR)local,CFile::typeText|CFile::modeReadWrite))
{
myFile.SeekToBegin();
myFile.ReadString(CPublic::str);
}
myFile.Close();
}