Changing the current directory with the help of dialog window(MFC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Changing the current directory with the help of dialog window(MFC app)
We can change directory with the help of the following code:
CFileDialog m_ldFile(TRUE);
m_ldFile.m_ofn.lpstrInitialDir="c:\\"; // the initial folder.
//below the dialog window is opened, then tfolders and eventually a file
and after automatically current directory is changed .
if(m_ldFile.DoModal()==IDOK)
{
//below finding out the path.
m_strPath=m_ldFile.GetPathName();
UpdateData(FALSE);
}
We don't need to open a file, but only a folder, in order to change
current directory.
Could you explain please, how I can change current directory without
opening file.
Alur.
 
Alur said:
Changing the current directory with the help of dialog window(MFC app)
We can change directory with the help of the following code:
CFileDialog m_ldFile(TRUE);
m_ldFile.m_ofn.lpstrInitialDir="c:\\"; // the initial folder.
//below the dialog window is opened, then tfolders and eventually a file
and after automatically current directory is changed .
if(m_ldFile.DoModal()==IDOK)
{
//below finding out the path.
m_strPath=m_ldFile.GetPathName();
UpdateData(FALSE);
}
We don't need to open a file, but only a folder, in order to change
current directory.
Could you explain please, how I can change current directory without
opening file.
Alur.

Try looking at SHBrowseForFolder()

/steveA
 
Hi Guys

What if I dont want to change the current directory when I ope
FileDialog...


Thank


-
stureb
 
Back
Top