DOC: CFileDialog Filter String Won't Work Under Windows 95

Last reviewed: July 10, 1997
Article ID: Q145687
2.20 4.00 WINDOWS NT kbprg kbdocerr kbdocfix

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with: Microsoft Visual C++, 32-bit Edition, versions 2.2, 4.0

SUMMARY

If sample code that lists an example filter string at the bottom of the CFileDialog::CFileDialog page in the Class Library Reference is used as a filter string with a CFileDialog, the filter string will not work properly on the Windows 95 Explorer-style common file dialog.

MORE INFORMATION

The Explorer-style common dialog will not accept spaces around the '|' vertical bar characters used to separate elements of the filter string.

The line of sample code should read:

static char BASED_CODE szFilter[] =

    "Chart Files (*.xlc)|*.xlc|Worksheet Files(*.xls)|*.xls|
    Data Files (*.xlc;*.xls)|*.xlc;*.xls|All Files (*.*)|*.*||";

This documentation problem was fixed in Visual C++ 4.1.


KBCategory: kbprg kbdocerr kbdocfix
KBSubcategory: MfcMisc MfcUI
Additional reference words: 2.20 4.00 4.10 CFileDialog m_ofn lpszFilter
Keywords : MfcMisc MfcUI kbdocerr kbdocfix kbprg
Technology : kbMfc
Version : 2.20 4.00
Platform : NT WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.