Allowing multiple file extensions when opening/saving MFC MDI documents ? 
Author Message
 Allowing multiple file extensions when opening/saving MFC MDI documents ?

Hi,

I have a standard MFC MDI application that can open, edit and save some
documents. I would like to support several file extensions in the Open File
and Save File dialog box. How can I accomplish this ?

Thanks in advance
Ulrik



Fri, 28 Mar 2003 03:00:00 GMT  
 Allowing multiple file extensions when opening/saving MFC MDI documents ?
Hi,

thats easy...

In the Constructor of the FileDialog:
CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR
lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY |
OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL
);

u must specified a Filter for the open dialog (lpszFilter)...

here an example (*.xlc, *.xls, *.*) for this filter:

static char BASED_CODE szFilter[] = "Chart Files (*.xlc)|*.xlc|Worksheet
Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files
(*.*)|*.*||";

I hope thats the problem u have...

Andreas Lander

Quote:

> Hi,

> I have a standard MFC MDI application that can open, edit and save some
> documents. I would like to support several file extensions in the Open File
> and Save File dialog box. How can I accomplish this ?

> Thanks in advance
> Ulrik



Fri, 28 Mar 2003 03:00:00 GMT  
 Allowing multiple file extensions when opening/saving MFC MDI documents ?
Hi,

Thanks for your response Andreas!

I know of the functionality that CFileDialog provides and that it easily can
be customized to allow several file extensions. But that doesn't help me
because I would like the MFC doc-view framework to allow several file
extensions when it handles a save or close request.

I know that the string table entry IDR_xxxxTYPE defines the primary file
extension, but I cannot figure out how to add additional extensions...?

Thanks
Ulrik



Sat, 29 Mar 2003 14:41:49 GMT  
 Allowing multiple file extensions when opening/saving MFC MDI documents ?
Hi,

ok, thats a little bit an other problem :-))
Can u overwrite the onOpen, onSave, OnSaveAs function in the Documents
class?? i dont know, im new on mfc...

Andreas

Quote:

> Hi,

> Thanks for your response Andreas!

> I know of the functionality that CFileDialog provides and that it easily can
> be customized to allow several file extensions. But that doesn't help me
> because I would like the MFC doc-view framework to allow several file
> extensions when it handles a save or close request.

> I know that the string table entry IDR_xxxxTYPE defines the primary file
> extension, but I cannot figure out how to add additional extensions...?

> Thanks
> Ulrik



Sat, 29 Mar 2003 03:00:00 GMT  
 Allowing multiple file extensions when opening/saving MFC MDI documents ?
here is a solution for your problem at CodeGuru.com

http://codeguru.earthweb.com/doc_view/RemovingFilters.shtml

Andreas

Quote:

> Hi,

> Thanks for your response Andreas!

> I know of the functionality that CFileDialog provides and that it easily can
> be customized to allow several file extensions. But that doesn't help me
> because I would like the MFC doc-view framework to allow several file
> extensions when it handles a save or close request.

> I know that the string table entry IDR_xxxxTYPE defines the primary file
> extension, but I cannot figure out how to add additional extensions...?

> Thanks
> Ulrik



Sat, 29 Mar 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Saving a document with multiple file extensions

2. Single Document / file extension, multiple views in MDI

3. open multiple file extensions in MDI??

4. Q: File Open Dialogbox allow multiple file selection

5. Saving a document with multiple extensions.

6. File Extensions and Open and Save Dialogs

7. MFC multiple document templates with SDI/MDI

8. Multiple documents in MFC MDI APP

9. multiple file extensions for one document template?

10. Finding open documents MFC - MDI

11. File Open and multiple extensions?

12. Displaying multiple file extensions on Open Dialog Box

 

 
Powered by phpBB® Forum Software