Return to Snippet

Revision: 41042
at February 11, 2011 07:07 by bits


Updated Code
CFileDialog m_idFile( true, "exe", NULL, OFN_HIDEREADONLY,
"Executables (*.exe)|*.exe|", AfxGetMainWnd());

// here comes the important line
m_idFile.m_ofn.lpstrInitialDir = "C:\\winnt";

if (m_idFile.DoModal()==IDOK)
{
//yadayada..
}

Revision: 41041
at February 11, 2011 04:08 by bits


Initial Code
CFileDialog m_idFile( true, "exe", NULL, OFN_HIDEREADONLY,
"Executables (*.exe)|*.exe|", AfxGetMainWnd());
m_idFile.m_ofn.lpstrInitialDir = "C:\\winnt";

if (m_idFile.DoModal()==IDOK)
{
//yadayada..
}

Initial URL
http://www.codeguru.com/forum/archive/index.php/t-146039.html

Initial Description
This shows how to define the directory where the MFC file dialog should start.

Initial Title
CFileDialog with Directory preset

Initial Tags


Initial Language
C++