void CPrintPortDlg::BrowseDir(CString strDir)
{
CFileFind cFind;
CString szDir = strDir;
if(szDir.Right(1) != "\\")
szDir += "\\";
szDir += "*.*";
BOOL res = cFind.FindFile(szDir);
while(res)
{
res = cFind.FindNextFile();
if(cFind.IsDirectory() && !cFind.IsDots())
{
CString str2 = cFind.GetFileName();
cout<<str2<<endl;
BrowseDir(cFind.GetFilePath());
}
else if(!cFind.IsDirectory() && !cFind.IsDots())
{
CString str = cFind.GetFileName();
CListBox *pCtrl = (CListBox *) GetDlgItem( IDC_LIST1 ) ;
pCtrl->AddString( _T(str) );
}
}
cFind.Close();
}
{
CFileFind cFind;
CString szDir = strDir;
if(szDir.Right(1) != "\\")
szDir += "\\";
szDir += "*.*";
BOOL res = cFind.FindFile(szDir);
while(res)
{
res = cFind.FindNextFile();
if(cFind.IsDirectory() && !cFind.IsDots())
{
CString str2 = cFind.GetFileName();
cout<<str2<<endl;
BrowseDir(cFind.GetFilePath());
}
else if(!cFind.IsDirectory() && !cFind.IsDots())
{
CString str = cFind.GetFileName();
CListBox *pCtrl = (CListBox *) GetDlgItem( IDC_LIST1 ) ;
pCtrl->AddString( _T(str) );
}
}
cFind.Close();
}