by Greg Duncan (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating:
(1 Votes)
This is a wrapper class for the FindNext functions. The FindNext, and related functions, allow the searching of a drive for a given file.
Wild cards are supported as are UNC and long file names.
It returns a string array, to n-tier enable it. It was also designed for reusability at the source code level. It is currently used by a number (5+) of production applications (in it's current form).
For more details and a usage example, please see the Declarations section of the class.
Inputs
FilePath
FileName
See the Usage Example or the Declarations for more details.
Code Returns
String Array
API DeclarationsPrivate Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
' Rtns True (non zero) on succes, False on failure
Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
' Rtns True (non zero) on succes, False on failure
Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long
Upload