当前位置:编程学习 > VC++ >>

VC的问题

void CDanganDlg::OnButtonRead() { CFile f; if(f.Open("\\test.txt",CFile::modeRead)==FALSE) return; CArchive ar(&f,CArchive::load); ar>>m_test1>>m_test2; ar.Close(); f.Close(); UpdateData(false); } void CDanganDlg::OnButtonSave() { UpdateData(TRUE); CFile f; f.Open("\\test.txt,CFile::modeCreate|CFile::modeWrite); CArchive ar(&f,CArchive::store); ar<<m_test1<<m_test2;ar.Close(); f.Close(); } D:\C++\dangan\danganDlg.cpp(192) : error C2001: newline in constant D:\C++\dangan\danganDlg.cpp(193) : error C2146: syntax error : missing ')' before identifier 'CArchive' D:\C++\dangan\danganDlg.cpp(193) : error C2660: 'Open' : function does not take 1 parameters D:\C++\dangan\danganDlg.cpp(194) : error C2065: 'ar' : undeclared identifier D:\C++\dangan\danganDlg.cpp(194) : error C2228: left of '.Close' must have class/struct/union type 执行 cl.exe 时出错.
追问:怎么包含啊!
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,