посимвольное чтение

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
void Cwinlab03View::OnUCopy()
{
CFileDialog CR(TRUE, 0, 0, 0, 0, 0, 0, 1);
CFileDialog CW(FALSE, 0, 0, 0, 0, 0, 0, 1);
if (CR.DoModal()==IDOK)
{
}
if (CW.DoModal()==IDOK)
{
CFile CFileRead, CFileWrite;
int Count(0);
char buf;
CFileRead.Open(CR.GetPathName(), CFile::modeRead);
CFileWrite.Open(CW.GetPathName(), CFile::modeCreate | CFile::modeWrite);
while(CFileRead.Read(&buf, 1))
{
Count++;
if(Count%2 == 1) CFileWrite.Write(&buf, 1);
}
CFileRead.Close();
CFileWrite.Close();
}
// TODO: Add your command handler code here
}