Method ITcFileAccess:FileFindFirst

Capability to step through files of a directory.

Syntax

virtual HRESULT TCOMAPI FileFindFirst (PCCH szFileName, PTcFileFindData pFileFindData , PTcFileFindHandle phFileFind); 

Parameter

szFileName: (type: PCCH) [in] directory or path and name of the file sought. The file name can contain placeholders such as asterisk (*) or question mark (?).

pFileFindData: (type: PTcFileFindData) [out] the description of the first file, cf. TcFileAccessServices.h

phFileFind: (type: PTcFileFindHandle) [out] handle for searching further with FileFindNext.

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 starts with finding files in a defined directory. The Method provides access to PTcFileFindData of the first found file, which contains the following information:

typedef struct TcFileFindData
{
TcFileHandle hFile;
DWORD dwFileAttributes;
ULONGLONG ui64CreationTime;
ULONGLONG ui64LastAccessTime;
ULONGLONG ui64LastWriteTime;
DWORD dwFileSizeHigh;
DWORD dwFileSizeLow;
DWORD dwReserved1;
DWORD dwReserved2;
CHAR cFileName[260];
CHAR cAlternateFileName[14];
WORD wReserved0;
} TcFileFindData, *PTcFileFindData;