16,471
社区成员
发帖
与我相关
我的任务
分享
void CMainFrame::OnOpenFile()
{
CString filename; // 通过对话框选取文件并获得文件名
CFileDialog file(true);
file.DoModal();
filename = file.GetFileName();
CStdioFile doc;// 打开文件
doc.Open(filename,CFile::modeRead|CFile::shareDenyWrite,NULL);
CString a; // 读取文件内容
int b[4];
for (int i=0;i<4;i++)
{
doc.ReadString(a);
a.Format("%d",b[i]);
}
CPudgeDoc* pDoc = (CPudgeDoc*)GetActiveDocument();
pDoc->a = b[0];
pDoc->b = b[1];
pDoc->c = b[2];
pDoc->d = b[4];
CPudgeView* pView = (CPudgeView*)GetActiveView();
pView->Invalidate(true);
// TODO: Add your command handler code here
}