
这个递归调用是错误的,你应该专门编写一个函历袜握数统计文件数目,然后将文件数作为返回值返回肢庆,在主函数中调用这个函数获取总数,然后显好渗示
使用CFileFind 类穗茄知CFileFind ff
CStringArray astr
if(ff.FindFile("d:\\mypath\\猜消*.*"纳旦))
{
while(ff.FindNextFile()) astr.Add(ff.GetFileName())
}
void CXXXDlg::SearchFiles(CString strMusicFolder){
CFileFind ff
strMusicFolder += _T("\\")
局扒喊 strMusicFolder += _T("桐野*.*")
BOOL res = ff.FindFile(strMusicFolder)
此世while (res)
{
res = ff.FindNextFile()
if (!ff.IsDirectory() && !ff.IsDots())
{
afxMessageBox(ff.GetFilePath())
}
}
ff.Close()
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)