CFile::GetPosition 
virtual DWORD GetLength( ) const;
比较一下就可以了

解决方案 »

  1.   

    CFile::Read returns the actual number of bytes read. If this number is less than the bytes requested, then the end of file has been reached.HOWTO: Test for End of File with CFile and CStdioFile Q88769
      

  2.   

    CFile::GetLength
    CFile::GetPosition 
      

  3.   

    所以,应该是:
    UINT nRead = CFile::Read( buf, nShouldRead );if( nRead < nShouldRead )
    {
    // eof reaches
    }
      

  4.   

    你可以用GetLength得到文件的长度,然后和当前文件指针位置比较来得到到底是否结束
      

  5.   

    Read的返回值:
    传输到缓冲区的字节数。注意对所有CFile类,如果到达文件尾,则返回值可能比nCount小。