(WINAPI create file - WINAPI write file) Flag used in winapi (FILE_FLAG_NO_BUFFERING) works fine, when I use winapi functions to write the file.
(WINAPI create file - CFile - write file) In this situation the error also had occured, but it was because of absent file name in CFile object, that was created from the file handle received from winapi CreateFile-function.
(CFile create file - Cfile - write file) When I use this flag (CFile::osNoBuffer), the exception appears when I try to write something to the file, talking me that some unrecognized error occured.
what may be wrong?
char chArr [] = "1234567890";
CFile file;
file.Open("c:\\mfc.txt",CFile::modeCreate| CFile::modeNoTruncate| CFile::modeWrite | CFile::osNoBuffer | CFile::osWriteThrough);
file.Write(chArr,sizeof(chArr)); // exception
file.Flush();
file.Close();