void TraverseDir( CString strDir, CAtlArray<CString>& arrFilePaths)
{
HANDLE hFile;
if (!DataConvert::StringEqual(strDir.Right(1), _T("\\")))
strDir.Append(_T("\\"));
CString strSearch = strDir+ _T("*.*");
LPCTSTR lpFileName(strSearch);
WIN32_FIND_DATA pNextInfo;
hFile = FindFirstFile(lpFileName, &pNextInfo);
if (hFile == INVALID_HANDLE_VALUE)
{
//搜索失败
exit(-1);
}
while (FindNextFile(hFile, &pNextInfo))
{
if (pNextInfo.cFileName[0] == '.')//过滤.和..
continue;
CString strFilePath;
strFilePath.Format(_T("%s"), pNextInfo.cFileName);
arrFilePaths.Add(strDir + strFilePath);
}
}