bonjour, mon prob est de lister un répertoire avec MFC .
j'ai ce code là mais il ne marche pas pour C:\\ alors qu'il execute avec E:\\
et merci de me lire
void CscanDlg::OnBnClickedOk()
{
CString cs;
dest.SetString("");
cs.SetString("C:\\");
AfficherListeFichiers(cs); // TODO: Add your control notification handler code here
//OnOK();
}
void CscanDlg::AfficherListeFichiers (CString Dossier)
{
CFileFind Find;
Find.
// Change de répertoire
SetCurrentDirectory (Dossier);
BOOL bWorking=Find.FindFile("*.*");
// Début de la recherche
while (bWorking)
{
bWorking = Find.FindNextFile();
if (Find.IsDirectory ()&&Find.GetFileName()!="."&&Find.GetFileName()!="..")
{
AfficherListeFichiers(Find.GetFilePath());
}
if(!(Find.IsDirectory ())&&Find.GetFileName()!="."&&Find.GetFileName()!="..")
{
i++;
}
else continue;
}
Find.Close ();
}