CString strProFolder;
strProFolder.Format(_T("%s*.*"),strPath);
// AfxMessageBox(strProFolder);
CFileFind fileFind;
BOOL bFind=fileFind.FindFile(strProFolder);
while (bFind)
{
bFind=fileFind.FindNextFile();
CString strCurFilePath;
strCurFilePath=fileFind.GetFilePath();
CString strFileExt=strCurFilePath.Mid(strCurFilePath.ReverseFind('.')+1);
if (GetFileAttributes(strCurFilePath)!=INVALID_FILE_ATTRIBUTES &&
(strFileExt==_T("tif")||strFileExt==_T("jpg")))
{
pDoc->m_strFileListVec->push_back(strCurFilePath);
}
}
pDoc->m_iCurrentProFileNum=0;
if (pDoc->m_strFileListVec->size()>0)
{
//文件名排序
sort(pDoc->m_strFileListVec->begin(),pDoc->m_strFileListVec->end(),SortFileName);
}
//
//对vector按文件名排序
bool SortFileName(CString &s1,CString &s2)
{
return s1<s2;
}
//