static char THIS_FILE[] = __FILE__;
#endif
-
-#define DIRSEL_TAG _T("Directory Selection")
-
+const LPCTSTR DIRSEL_TAG = _T("Directory Selection");
/////////////////////////////////////////////////////////////////////////////
// COpenDlg dialog
{
CString s;
- s.LoadString(IDS_ALLFILES);
- CFileDialog *pdlg = new CFileDialog(TRUE, NULL, NULL,
- OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, s);
- if (NULL != pdlg)
+ VERIFY(s.LoadString(IDS_ALLFILES) );
+ CFileDialog pdlg(TRUE, NULL, DIRSEL_TAG,
+ OFN_NOTESTFILECREATE | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, s);
+ CString title;
+ VERIFY(title.LoadString(IDS_OPEN_TITLE));
+ pdlg.m_ofn.lpstrTitle = (LPCTSTR)title;
+ pdlg.m_ofn.lpstrInitialDir = (LPSTR)pszFolder;
+
+ if (pdlg.DoModal()==IDOK)
{
- TCHAR buf[MAX_PATH] = DIRSEL_TAG;
- CString title;
- VERIFY(title.LoadString(IDS_OPEN_TITLE));
- pdlg->m_ofn.lpstrTitle = (LPCTSTR)title;
- pdlg->m_ofn.lpstrInitialDir = (LPSTR)pszFolder;
- pdlg->m_ofn.nMaxFile = MAX_PATH;
- pdlg->m_ofn.lpstrFile = buf;
-
- if (pdlg->DoModal()==IDOK)
- {
- path = pdlg->GetPathName();
- delete pdlg;
- return TRUE;
- }
- path.Empty();
- delete pdlg;
+ path = pdlg.GetPathName();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
}
- return FALSE;
}
void COpenDlg::OnSelchangeLeftCombo()