<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-6319745239117838&dt=1192361838062&lmt=1192361838&format=300x250_as&output=html&correlator=1192361838046&url=http%3A%2F%2Fwww.programfan.com%2Farticle%2Fshowarticle.asp%3Fid%3D2537&ad_type=text_image&ref=http%3A%2F%2Fwww.google.cn%2Fsearch%3Fcomplete%3D1%26hl%3Dzh-CN%26ie%3DGB2312%26q%3DVC%25B1%25A3%25B4%25E6%25CA%25FD%25BE%25DD%26meta%3D%26aq%3Dnull&cc=100&ga_vid=567952666.1192361838&ga_sid=1192361838&ga_hid=1651908726&flash=9&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="300" scrolling="no" height="250" allowtransparency="allowtransparency"> |
{
// TODO: Add your control notification handler code here
// 这种用bSave的方式来判断是否保存过,这样不好,待考虑。
// if (!bSave)
{
int iYear = m_cMonthView.GetYear();
int iMonth = m_cMonthView.GetMonth();
int iDay = m_cMonthView.GetDay();
CString sFileName;
sFileName.Format("%d-%d-%d.txt", iYear, iMonth, iDay);
CFileDialog dlg(FALSE, "txt", sFileName,
OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY,
"文本文件(*.txt)|*.txt||", this);
dlg.m_ofn.lpstrTitle = _T("保存日记文件");
if (dlg.DoModal() == IDOK)
{
// 实现存盘
CString fileName = dlg.GetPathName();
CFile file(fileName, CFile::modeCreate|CFile::modeReadWrite|CFile::shareExclusive);
CArchive ar(&file, CArchive::store|CArchive::bNoFlushOnDelete);
UpdateData(TRUE);
ar<<m_sComment;
ar.Close();
bSave = TRUE;
m_sFileName = fileName;
}
}
/*
else
{
CFile file(m_sFileName, CFile::modeCreate|CFile::modeReadWrite|CFile::shareExclusive);
CArchive ar(&file, CArchive::store|CArchive::bNoFlushOnDelete);
UpdateData(TRUE);
ar<<m_sComment;
ar.Close();
}
*/
}