*.cpp
void CDLGSerializeDlg::OnWRITE()
{
// TODO: Add your control notification handler code here
CFile cf;
UpdateData();
cf.Open("D:\\test.txt",CFile::modeCreate|CFile::modeWrite);
CArchive ar(&cf,CArchive::store);
Serialize(ar);
//ar.WriteString(m_ftxt);
m_ftxt="";
ar.Flush();
cf.Close();
UpdateData(FALSE);
}
--read--
void CDLGSerializeDlg::OnREAD()
{
// TODO: Add your control notification handler code here
CFile cf;
//char data[50];
UpdateData();
cf.Open("D:\\test.txt",CFile::modeRead);
CArchive ar(&cf,CArchive::load);
Serialize(ar);
/*
ar.Read(data,cf.GetLength());
for(unsigned int i=0;i
}
}
No comments:
Post a Comment