Solved

Changing file types in Save As dialog with CFileDialog

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

615 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