1) открытие запись файлов

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
void CmfcFileORWView::OnFileOpen()
{
CFileDialog dlg(true);
CFileDialog dlg1(false);
CString s,s1;
char buf[128]={};
dlg.DoModal();
s = dlg.GetPathName();
CFile myFile, myFile1;
myFile.Open(s,CFile::modeRead);
myFile.Read(buf,128);
myFile.Close();
dlg1.DoModal();
s1 = dlg1.GetPathName();
myFile1.Open(s1,CFile::modeCreate | CFile::modeWrite);
myFile1.Write(buf,sizeof(buf));
myFile1.Close();
// TODO: Add your command handler code here
}