Im working on a simple file list program that list folders and files using CFileFind. Heres how the program goes!
1. User types a directory in a edit box
2. Presses button and files and folders get listed.
**If user wants to go back a directory
1. Presses the back button
And the back button is my problem. I know the problem is the Wildcard format. Im using a CString with a addition "/.." eg....(CString cp = m_Directory + "/..");
I tried CString cp = m_Directory + "/.." + "*.*" and vice versa with no luck
My question is how do I add a "*.*" to the CString cp? If I don't add "*.*", I know that all the files will not get listed.Only one folder gets listed when I press the back button
Can you help me with this problem.
-THX
oh yeah. Here is the code im using for the back button
Code:
void CAlDlg::OnButton1()
{
m_b.ResetContent();
UpdateData(true);
CString oke = m_o;
UpdateData(false);
CFileFind OneFile;
CString FileName, DirName;
BOOL BeWorking;
DirName = oke + "/..";
BeWorking = OneFile.FindFile (DirName);
while (BeWorking)
{
BeWorking = OneFile.FindNextFile () ;
if (OneFile.IsDots ()) continue;
m_b.AddString(OneFile.GetFileName ());
GetDlgItem(IDC_EDIT3)->SetWindowText(OneFile.GetRoot());
}
OneFile.Close ();
}