myFile.write(buf,50);
myFile.Close();
when i open the file for read, it has my 50 bytes at the beginning of the
file, and the remaining 50 bytes is from the existing file.
why does this happen? why doesn't it write an eof after my 50 bytes and
truncate the file at 50?
any help is appreciated
"Richard Ripps" <r...@nycap.rr.com> wrote in message
news:eOBfhyJvAHA.1456@tkmsftngp02...
1. Try the CFile::modeCreate flag, that directs it to create a new file. If
the file already exists, it is truncated to 0 length.
2. Try CFile::SetLength(DWORD dwNewLen); in this example,
myFile.SetLength(50);
HTH,
Mehdi
--
Looking for a scandisk-like control (in terms of its UI) to use within your
program? Try mine:
http://www.codeproject.com/useritems/checkerctrl.asp
"Richard Ripps" <r...@nycap.rr.com> wrote in message
news:eOBfhyJvAHA.1456@tkmsftngp02...