CFile::SetLength 
virtual void SetLength( DWORD dwNewLen );
throw( CFileException );ParametersdwNewLenDesired length of the file in bytes. This value can be larger or smaller than the current length of the file. The file will be extended or truncated as appropriate.ResCall this function to change the length of the file.Note   With CMemFile, this function could throw a CMemoryException object. 

解决方案 »

  1.   

    SetLength()的参数是DWLOAD,但是我的视频文件可能有4,5G的,那就不能用了。
      

  2.   

    first SetFilePointer( )
    then  SetEndOfFile( )
    Note that it is not an error to set the file pointer to a position beyond the end of the file. The size of the file does not increase until you call the SetEndOfFile, WriteFile, or WriteFileEx function. A write operation increases the size of the file to the file pointer position plus the size of the buffer written, leaving the intervening bytes uninitialized. 
      

  3.   

    有没有相关源码啊,用SetFilePointer()和SetEndOfFile()