.
The CFileFind class encapsulates the task of programmatically searching through a directory for files of a specified name or nature. It can be used to programmatically search for directories, too.
CFileFind finder; BOOL bWorking = finder.FindFile("*.*"); while (bWorking) { bWorking = finder.FindNextFile(); cout << (LPCTSTR) finder.GetFileName() << endl; }