-
August 14th, 2005, 08:32 AM
#1
MFC Doc/View: How to modify the default 'Open' dialog?
Q: How to modify the default 'Open' dialog?
A:
- Delete or comment the following line added in message map of CWinApp-derived class by the AppWizard:
Code:
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
- Using ClassWizard map yourself ID_FILE_OPEN command
- Write this code in ID_FILE_OPEN handler function:
Code:
void CMyApp::OnFileOpen()
{
LPCTSTR pszFilter =
_T("Bitmap files (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|")
_T("JPEG files (*.jpg;*.jpeg;*.jpe;*.jfif)|*.jpg;*.jpeg;*.jpe;*.jfif||");
CFileDialog dlgFile(TRUE, NULL, NULL,
OFN_HIDEREADONLY,
pszFilter,
AfxGetMainWnd());
if(IDOK == dlgFile.DoModal())
{
OpenDocumentFile(dlgFile.GetPathName());
}
}
Last edited by Andreas Masur; September 18th, 2005 at 05:08 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|