CFileDialog How to set default file type list 
Author Message
 CFileDialog How to set default file type list

I would like to set the default file type to show a paricular file extention
and files.
How do I do this?

Ken



Sat, 21 Aug 2004 03:55:19 GMT  
 CFileDialog How to set default file type list
The nFilterIndex member of the OPENFILENAME struct (m_ofn)


Sat, 21 Aug 2004 04:19:11 GMT  
 CFileDialog How to set default file type list
I hope the following code will help you:

char szFilters[]="Myself Data type (*.abc)|*.abc| All Files (*.*)|*.*||";

 CFileDialog dlg(     TRUE,     //BOOL bOpenFileDialog
                              "",         //LPCTSTR lpszDefExt = NULL
                              "",         //LPCTSTR lpszFileName = NULL
                              OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,
                              szFilters, //lpszFilter = NULL
                              this ); //CWnd* pParentWnd = NULL
...........................

--
Alex


Quote:
> The nFilterIndex member of the OPENFILENAME struct (m_ofn)



Sat, 21 Aug 2004 04:46:59 GMT  
 CFileDialog How to set default file type list
Thank you all for your responses
Ken


Quote:
> I hope the following code will help you:

> char szFilters[]="Myself Data type (*.abc)|*.abc| All Files (*.*)|*.*||";

>  CFileDialog dlg(     TRUE,     //BOOL bOpenFileDialog
>                               "",         //LPCTSTR lpszDefExt = NULL
>                               "",         //LPCTSTR lpszFileName = NULL
>                               OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,
>                               szFilters, //lpszFilter = NULL
>                               this ); //CWnd* pParentWnd = NULL
> ...........................

> --
> Alex


> > The nFilterIndex member of the OPENFILENAME struct (m_ofn)



Sat, 21 Aug 2004 06:03:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how to list multiple specific file file types in CFileDialog

2. how to list multiple specific file file types in CFileDialog

3. how to list multiple specific file types in CFileDialog

4. Set Attributes of listed files/directories in CFileDialog-objects

5. How to set a default folder for CFileDialog?

6. Change Default File Type to Source File?

7. Change Default File Type to Source File?

8. Setting a default doc type and view-Newbie

9. Help setting specific file types in the Open File Dialog of my SDI

10. How to set file-types in Doc/View File dialogs

11. Open File - file types list

12. CFileDialog file type with more than 3 char?

 

 
Powered by phpBB® Forum Software