zero if the file found is the last one in the directory or if an error occurred. To get extended error information, call the Win32 function GetLastError. If the file found is the last file in the directory, or if no matching files can be found, the GetLastError function returns ERROR_NO_MORE_FILES.
// start working for files
BOOL bWorking = finder.FindFile(strWildcard);
while (bWorking)
{
bWorking = finder.FindNextFile(); if (finder.IsDots())
continue;
if (!finder.IsDirectory())
{
CString str = finder.GetFilePath();
MessageBox(str);
}
} finder.Close();
为什么 bWorking = finder.FindNextFile(); 失败了,返回了0呢?