There are a couple of ways to find/search files in a folder/directory. Usually, Win32 programmers use FindFirstFile & FindNextFile functions to find the files in a particular folder. MFC provides a simplified way of finding the files using CFileFind class.
The following example shows how to find files in a particular folder. This example is also helpful to find files recursively:
You can call the above function anywhere in your program. For example, the following function call shows all the files in C: drive recursively:
FileFind(_T("C:\\*.*"));
—
Finding files in a folder / directory using MFC!
One thought on “Finding files in a folder / directory using MFC!”