Method ITcFileAccess:FileFindFirst

Option to scroll through the files in a directory.

Syntax


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

Method ITcFileAccess:FileFindFirst 1: 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.

Parameter

Name

Type

Description

szFileName

PCCH

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

pFileFindData

PTcFileFindData

[out] the description of the first file, cf. TcFileAccessServices.h

phFileFind

PTcFileFindHandle

[out] handle for searching further with FileFindNext.

Description

This method starts by searching for files in a given directory. The method grants access to PTcFileFindData of the first file found, with 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;