Using lpstrCustomFilter in OPENFILENAME structure 
Author Message
 Using lpstrCustomFilter in OPENFILENAME structure

  I'm trying to customize my File Open dialog to choose a default file
extension, then preserve the last extension chosen by the user. Here's
what I've got:

                m_ofn.lpstrTitle = "Open Image File";
        m_ofn.lpstrInitialDir = m_rDefDir;
        m_ofn.Flags |= OFN_EXPLORER;
        m_ofn.nFilterIndex = 0;
        m_ofn.lpstrFilter =
        m_ofn.lpstrDefExt = "TIF";
        static LPTSTR szFilter2 = "TIF\0*.TIF\0";
        m_ofn.lpstrCustomFilter = szFilter2;
        m_ofn.nMaxCustFilter = sizeof(szFilter2);

  This code in fact starts out selecting the TIF files for display.
However, the user's selection of another file extension doesn't get
saved to lpstrCustomFilter. What am I missing?

Benjamin Eakin

Mon, 03 Mar 2003 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Problems in saving files by using OPENFILENAME ofn structure

2. OPENFILENAME structure member - lpstrFilter

3. OPENFILENAME structure

4. CFileDialog & OPENFILENAME structure

5. Setting lpstrInitialDir in OPENFILENAME structure

6. Problem using structures in structures

7. Another name for the OPENFILENAME

8. OPENFILENAME multi-selected files

9. Windows 2000 OpenFileName

10. openfilename dialog box


12. OpenFileName problem


Powered by phpBB® Forum Software