我这样打开文件显示到editview中为什么错?
BOOL CYouDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
char buf[1024];
CFile xml;
CFileException e;
if(xml.Open("1.txt",CFile::modeWrite|CFile::modeRead,&e))
{
AfxMessageBox("Open file error!");
}
xml.Read(buf,1024);
CEdit& theEdit = MyEdit::GetEditCtrl();
for(int i=0;i<1024;i++)
m_str = m_str+buf[i];
xml.Close();
UpdateData(false);
AfxMessageBox(_T("读文件成功!"));
return TRUE;
}