Solved

Changing file types in Save As dialog with CFileDialog

Posted on 1997-10-09
2
556 Views
Last Modified: 2013-11-20
I'm using a CFileDialog class with a custom filter list such as "Windows Bitmaps (*.bmp)|*.bmp|Windows Metafile (*.wmf)|*.wmf||" and while the CFileDialog class does display these file types in the combo box, when the user chooses a type, the file name in the edit box does not update with the right extention. For example, if the user selects Windoes Metafile, I would expect the filename in the edit box to be changed to have the WMF extention. If Windows or MFC doesn't do this directly, I already know how to respond to OnTypeChange notifications but how can I change the filename in the dialog while it is still being displayed?
Thanks in advance.
0
Comment
Question by:Sherwin7
2 Comments
 
LVL 4

Accepted Solution

by:
mbhakta earned 100 total points
ID: 1307889
Maybe the way you are trying to implement this is not correct. Here is a sample code which might help you.

CFileDialog fdlg( TRUE,"BMP","",0,   "Bitmap  image (*.BMP)|*.BMP|All files (*.*)|*.*||",this);

fdlg.DoModal();

Try this. This works for me.
0
 

Author Comment

by:Sherwin7
ID: 1307890
I am using the dialog for "Save As" the example you gave is for an "Open" dialog. Thanks anyways.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
post4 challenge 28 99
MaxSpan challenge 9 94
unix example issues 18 89
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question