附录1
voidCTxtDlg::OnOpen() { // TODO: Add your control notification handler code here CFileDialogdlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, \ CStringstrPath,strText=\ if(dlg.DoModal() == IDOK) { strPath = dlg.GetPathName(); m_OP.SetWindowText(strPath); CFilefile(strPath,CFile::modeRead); char read[10000]; file.Read(read,10000); for(int i=0;i 附录2 voidCTxtDlg::OnSave() { // TODO: Add your control notification handler code here CFileDialogdlg(FALSE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, \ CStringstrPath,strText=\ char write[10000]; if(dlg.DoModal() == IDOK) { strPath = dlg.GetPathName(); if(strPath.Right(4) != \ strPath += \ m_SP.SetWindowText(strPath); CFilefile(_T(strPath),CFile::modeCreate|CFile::modeWrite); m_Edit1.GetWindowText(strText); strcpy(write,strText); file.Write(write,strText.GetLength()); file.Close(); } }