Does this bit of code work?
-
CFileFind finder; static const TCHAR szFileToFind[] = _T("*.dll"); Cstring Plugins[100]; int tag = 0; bool bResult = finder.FindFile(szFileToFind); while (bResult) { // Grab actual results finder.FindNextFile(); Plugins[tag] == (LPCTSTR) finder.GetFileName(); tag++; // Get next file bResult = finder.FindFile(szFileToFind); } finder.Close(); I am away from a compiler ATM. Thanks for your help. Darroll Not one person lives in the present. Only the past. I can prove it.
-
CFileFind finder; static const TCHAR szFileToFind[] = _T("*.dll"); Cstring Plugins[100]; int tag = 0; bool bResult = finder.FindFile(szFileToFind); while (bResult) { // Grab actual results finder.FindNextFile(); Plugins[tag] == (LPCTSTR) finder.GetFileName(); tag++; // Get next file bResult = finder.FindFile(szFileToFind); } finder.Close(); I am away from a compiler ATM. Thanks for your help. Darroll Not one person lives in the present. Only the past. I can prove it.
The
CFileFind
interface is a bit wonky.BOOL bWorking = finder.FindFile ( szFileToFind );
while ( bWorking )
{
bWorking = finder.FindNextFile();
Plugins[tag] = finder.GetFileName();
}The return value from
FindNextFile()
indicates whether you just got the last file in the search, which is contrary to how most classes do it (where the return indicates whether you've gone through all the files). When it returns FALSE, you still have one file left to process. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm