Cant set CFileDialogs default directory

Cant set CFileDialogs default directory

Post by Q2hyaXMgQm » Fri, 04 Nov 2005 20:32:03


I have a cfiledialog and I want to set a default directory for it to open un
into. Here is my code: (What is wrong?) I know that the value of
theApp.m_sMissionDir is correct.

CString sz=_T("Mission (*.*)|*.*|");
CString se=_T("*.mcf");
CFileDialog dlgFile(TRUE, NULL, NULL, NULL, (LPCTSTR)sz);

dlgFile.m_ofn.lpstrInitialDir = theApp.m_sMissionDir;
dlgFile.m_ofn.lpstrTitle = sTitle;

if (dlgFile.DoModal() == IDCANCEL)
{
return;
}
 
 
 

Cant set CFileDialogs default directory

Post by Eugene Sha » Sat, 05 Nov 2005 05:00:40

CDialog::m_ofn.lpstrInitialDir memder must contain only folder name
(e.g. "My Documents"), but not a full or relative folder path.

 
 
 

Cant set CFileDialogs default directory

Post by Eugene Sha » Sat, 05 Nov 2005 05:01:05

CDialog::m_ofn.lpstrInitialDir member must contain only folder name
(e.g. "My Documents"), but not a full or relative folder path.