CAtlFile::Read
This documentation is archived and is not being maintained.

CAtlFile::Read 

Call this method to read data from a file starting at the position indicated by the file pointer.


HRESULT Read(
   LPVOID pBuffer,
   DWORD nBufSize
) throw( );
HRESULT Read(
   LPVOID pBuffer,
   DWORD nBufSize,
   DWORD& nBytesRead 
) throw( );
HRESULT Read(
   LPVOID pBuffer,
   DWORD nBufSize,
   LPOVERLAPPED pOverlapped
) throw( );
HRESULT Read(
   LPVOID pBuffer,
   DWORD nBufSize,
   LPOVERLAPPED pOverlapped,
   LPOVERLAPPED_COMPLETION_ROUTINE pfnCompletionRoutine
) throw( );

Parameters

pBuffer

Pointer to the buffer that will receive the data read from the file.

nBufSize

The buffer size in bytes.

nBytesRead

The number of bytes read.

pOverlapped

The overlapped structure. See lpOverlapped in ReadFile in the Platform SDK.

pfnCompletionRoutine

The completion routine. See lpCompletionRoutine in ReadFileEx in the Platform SDK.

Returns S_OK on success, or an error HRESULT on failure.

The first three forms call ReadFile, the last ReadFileEx to read data from the file. Use CAtlFile::Seek to move the file pointer.

Show:
© 2016 Microsoft