Solved

Changing file types in Save As dialog with CFileDialog

Posted on 1997-10-09
2
534 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now