Method ITcFileAccess:FileRead

Read data from a file.

Syntax

virtual HRESULT TCOMAPI
FileRead(TcFileHandle hFile, PVOID pData, UINT cbData, PUINT pcbRead);

Parameter

hFile: (type: TcFileHandle) [in] refers to the previously opened file.

pData: (type: PVOID) [out] storage location of the data to be read.

cbData: (type: PVOID) [in] maximum size of the data to be read (size of the memory behind pData).

pcbRead: (type: PUINT) [out] size of the data that was read.

Return value

If successful, S_OK ("0") or another positive value will be returned, cf. Return values. Extended messages refer in particular to the column HRESULT in ADS Return Codes.

A particularly interesting error code is ADSERR_DEVICE_TIMEOUT if the timeout (5 seconds) has elapsed.

Description

This method retrieves data from a file defined by the file handle. Data will be stored in pData while pcbRead provides length of given data.