|
Question : EOF in CFile
|
|
Hi, I remembered that I saw somebody post a URL of Microsoft about EOF. Anybody knows that link?
|
|
Answer : EOF in CFile
|
|
Sorry, don't know the link, but that's how it works:
To detect EOF, check the return value of 'CFile::Read()'. If it is less than the number of bytes requested, you're at the end...
From the docs: begin quote--> CFile::Read virtual UINT Read( void* lpBuf, UINT nCount ); throw( CFileException );
Return Value
The number of bytes transferred to the buffer. Note that for all CFile classes, the return value may be less than nCount if the end of file was reached.
<-- end quote
Feel free to ask if you need an example...
|
|
|
|