MFC文件读写的问题 有不清楚的还可以问我~求大虾指教~感激不尽
这里是我的消息处理函数voidCMYFILE1View::OnFileWrite(){//TODO:AddyourcommandhandlercodehereCFilef...
这里是我的消息处理函数 void CMYFILE1View::OnFileWrite()
{
// TODO: Add your command handler code here
CFile file("FileIO.txt",CFile::modeCreate|CFile::modeWrite);
char m_nWenzi[100]="欢迎使用《Visual C++ 面向程序编程教材》(第2版)!";
file.Write(m_nWenzi,strlen(m_nWenzi));
file.Close();
}
void CMYFILE1View::OnFileRead()
{
// TODO: Add your command handler code here
CFile file("FileIO.txt",CFile::modeRead);
char m_nWenzi[100];
memset(m_nWenzi,0,100);
file.Read(m_nWenzi,100);
MessageBox(m_nWenzi);
file.Close();
}
MYFILE1Doc.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CMYFILE1Doc::OnFileWrite(void)" (?OnFileWrite@CMYFILE1Doc@@IAEXXZ)
Debug/MYFILE1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
MYFILE1.exe - 2 error(s), 0 warning(s) 展开
{
// TODO: Add your command handler code here
CFile file("FileIO.txt",CFile::modeCreate|CFile::modeWrite);
char m_nWenzi[100]="欢迎使用《Visual C++ 面向程序编程教材》(第2版)!";
file.Write(m_nWenzi,strlen(m_nWenzi));
file.Close();
}
void CMYFILE1View::OnFileRead()
{
// TODO: Add your command handler code here
CFile file("FileIO.txt",CFile::modeRead);
char m_nWenzi[100];
memset(m_nWenzi,0,100);
file.Read(m_nWenzi,100);
MessageBox(m_nWenzi);
file.Close();
}
MYFILE1Doc.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CMYFILE1Doc::OnFileWrite(void)" (?OnFileWrite@CMYFILE1Doc@@IAEXXZ)
Debug/MYFILE1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
MYFILE1.exe - 2 error(s), 0 warning(s) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询