BOOL FindDirectory( CString &mFilePath);'CTapDlg::CString' : member from enclosing class is not a type name, static, or enumerator
时间: 2024-06-01 19:11:13 浏览: 70
strPathName )
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;
// Append a trailing backslash if not present
if(strPathName.Right(1) != "\\")
strPathName += "\\";
// Search for the first file in the directory
hFind = FindFirstFile(strPathName + "*", &FindFileData);
if(hFind == INVALID_HANDLE_VALUE)
return FALSE;
// Loop through all the files in the directory
do
{
// Ignore the "." and ".." directories
if(FindFileData.cFileName[0] == '.')
continue;
// Check if the file is a directory
if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
// Check if the directory name matches the search string
if(CString(FindFileData.cFileName).CompareNoCase(strPathName) == 0)
{
FindClose(hFind);
return TRUE;
}
else
{
// Recurse into the subdirectory
if(FindDirectory(strPathName + FindFileData.cFileName))
{
FindClose(hFind);
return TRUE;
}
}
}
} while(FindNextFile(hFind, &FindFileData));
FindClose(hFind);
return FALSE;
}
阅读全文