- void ReadSource()
- {
- CFileDialog ccFileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT,
- _T("Image files(*.png; *.jpg)|*.png;*.jpg|All files(*.*)|*.*||"), NULL);
- if (ccFileDlg.DoModal() == IDOK)
- {
- CString strPathName = ccFileDlg.GetPathName();
- CString strDir = strPathName.Left(strPathName.ReverseFind('\\'));
- ReadFile(strDir))
- }
- }
// void ReadFile(const CString& strPath)
- bool ReadFile(const CString& strPath)
- {
- CFileFind ccFileFind;
- CString strTemp = strPath;
- CString strDir = strPath + _T("\\") + _T("*.*");
- CString strFile;
- BOOL bFind = ccFileFind.FindFile(strDir);
- while (bFind)
- {
- bFind = ccFileFind.FindNextFile();
- if (ccFileFind.IsDots())
- {
- // 如果是".",则不扫描
- continue;
- }
- else if (ccFileFind.IsDirectory())
- {
- // 如果是目录,则继续扫描
- strFile = ccFileFind.GetFileName();
- strTemp = strTemp + _T("\\") + strFile;
- this->ReadFile(strTemp);
- }
- else
- {
- // 如果是资源文件,则存储
- //strFile = ccFileFind.GetFileName();
- strFile = ccFileFind.GetFilePath();
- m_vecResDirData.push_back(str); // std::vector<CString> m_vecResDirData
- }
- }
- ccFileFind.Close();
- return true;
- }