Solved

Changing file types in Save As dialog with CFileDialog

Posted on 1997-10-09
2
584 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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. …
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

735 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