Compartilhar via


CFileFind::FindFile

Call this member function to open a file search.

virtual BOOL FindFile(
   LPCTSTR pstrName = NULL,
   DWORD dwUnused = 0 
);

Parameters

  • pstrName
    A pointer to a string containing the name of the file to find. If you pass NULL for pstrName, FindFile does a wildcard (*.*) search.

  • dwUnused
    Reserved to make FindFile polymorphic with derived classes. Must be 0.

Return Value

Nonzero if successful; otherwise 0. To get extended error information, call the Win32 function GetLastError.

Remarks

After calling FindFile to begin the file search, call FindNextFile to retrieve subsequent files. You must call FindNextFile at least once before calling any of the following attribute member functions:

Example

See the example for CFileFind::IsDirectory.

Requirements

Header: afx.h

See Also

Reference

CFileFind Class

Hierarchy Chart

CFileFind::FindNextFile

Other Resources

CFileFind Members