Where Do I Add the Filters used for File->Open?
-
Hi there. I have created an MDI program, and I need to know, where do I add the filters used when a user does a File->Open? Sorry if this is an inane question, but I'm used to using Borland C++ Builder, and obviously VS .Net does things differently. Thanks! James A Beggs American Quarter Horse Association Manager of Product Development
-
Hi there. I have created an MDI program, and I need to know, where do I add the filters used when a user does a File->Open? Sorry if this is an inane question, but I'm used to using Borland C++ Builder, and obviously VS .Net does things differently. Thanks! James A Beggs American Quarter Horse Association Manager of Product Development
Are you using CFileDialog or GetOpenFileName()?
-
Are you using CFileDialog or GetOpenFileName()?
I, uhm.... dont know? :) I used the wizard to generate an automatic MDI for me, and it set up the parent's menu system and everything. It had a section in the wizard for inputting the file name to open, but I decided to add more to it. The main application class inherits from CWinApp. The wizard automatically created a Message Map that maps its file->open to CWinAPP::OnFileOpen (Man, I feel stupid. I wouldn't think working on something so simple would have been so hard when translating from Borland C++ Builder to VS .Net. I guess C++ Builder's RAD spoiled me :/ ) James A Beggs American Quarter Horse Association Manager of Product Development
-
I, uhm.... dont know? :) I used the wizard to generate an automatic MDI for me, and it set up the parent's menu system and everything. It had a section in the wizard for inputting the file name to open, but I decided to add more to it. The main application class inherits from CWinApp. The wizard automatically created a Message Map that maps its file->open to CWinAPP::OnFileOpen (Man, I feel stupid. I wouldn't think working on something so simple would have been so hard when translating from Borland C++ Builder to VS .Net. I guess C++ Builder's RAD spoiled me :/ ) James A Beggs American Quarter Horse Association Manager of Product Development
Sounds like you simply need to modify the IDR_MAINFRAME string in the resource file.
-
Sounds like you simply need to modify the IDR_MAINFRAME string in the resource file.
Well... it has a string in the string table, IDR_ImageFileMasterTYPE (the name if the application is Image FileMaster), and it contains the string that is listed when you do a File->Open, including a path, a filter, etc. But, in modifying the string so that it contained more than one filter made no difference; it listed the new string in the file->open dialog, but didn't actually show the new file extensions. James A Beggs American Quarter Horse Association Manager of Product Development
-
Well... it has a string in the string table, IDR_ImageFileMasterTYPE (the name if the application is Image FileMaster), and it contains the string that is listed when you do a File->Open, including a path, a filter, etc. But, in modifying the string so that it contained more than one filter made no difference; it listed the new string in the file->open dialog, but didn't actually show the new file extensions. James A Beggs American Quarter Horse Association Manager of Product Development
Probably because an MDI app, by default, does not know how to handle more than one file type. Read MSDN article Q141921.
-
Probably because an MDI app, by default, does not know how to handle more than one file type. Read MSDN article Q141921.
Well, how irritating. I changed the string, as it said, but according to the article, it wasn't enough. Oh well, thanks for the pointer to the article! James A Beggs American Quarter Horse Association Manager of Product Development
-
Well, how irritating. I changed the string, as it said, but according to the article, it wasn't enough. Oh well, thanks for the pointer to the article! James A Beggs American Quarter Horse Association Manager of Product Development
James A Beggs wrote: I changed the string, as it said, but according to the article, it wasn't enough. Right, you must implement at least the first four steps in order to achieve the desired results. Simply changing the string does nothing. I would suggest stepping through the MFC code for opening documents to see what is going on. Knowing how/why MFC does what it does is always helpful.
-
James A Beggs wrote: I changed the string, as it said, but according to the article, it wasn't enough. Right, you must implement at least the first four steps in order to achieve the desired results. Simply changing the string does nothing. I would suggest stepping through the MFC code for opening documents to see what is going on. Knowing how/why MFC does what it does is always helpful.
I think I'll also be getting a book on MFC, as I haven't really worked with it either. Thanks again. James A Beggs American Quarter Horse Association Manager of Product Development
-
I think I'll also be getting a book on MFC, as I haven't really worked with it either. Thanks again. James A Beggs American Quarter Horse Association Manager of Product Development
Actually, could you suggest a good book on MFC? James A Beggs American Quarter Horse Association Manager of Product Development
-
Actually, could you suggest a good book on MFC? James A Beggs American Quarter Horse Association Manager of Product Development
"Good" is in the eye of the reader! I have Kruglinski's Inside Visual C++ (which includes nothing for v6), and Mastering MFC Development Using Microsoft Visual C++ 6.0 by Microsoft Press. I believe all books are intended for a particular target audience. I've read very little of either book because most of what they contain I've known about simply by using MFC from its inception (see my earlier note on stepping through code). I'm no MFC expert, and probably learn 1-2 new things about it each week.