CFileFind finder;
CString strPath("");
BOOL bWorking = finder.FindFile(_T(".\\bin\\*.*"));
while (bWorking)
{
bWorking = finder.FindNextFile();
strPath = finder.GetFilePath();
//strPath就是所要获取Test目录下的文件夹和文件(包括路径)
//m_List.AddString(strPath);
CString firstFileName = "";
firstFileName = strPath.Right(strPath.GetLength() - strPath.ReverseFind('\\') - 1);//从路径中截取文件名
if (IsWantedFile(firstFileName))
{
m_listPlay.AddString(firstFileName);
}
}
finder.Close();
release调试模式运行可以正常获取路径及提取文件名,我单独打开exe文件而不可以,为什么?跪求大佬解答!