CFileDialog and wildcards - Programmer

This is a discussion on CFileDialog and wildcards - Programmer ; I'm using CFileDialog in MFC. I pass it wildcards, like for instance *.txt. It shows all .txt files ok. However, if a user types in *.text and hits enter key, instead of re-populating the file list with files with the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: CFileDialog and wildcards

  1. CFileDialog and wildcards

    I'm using CFileDialog in MFC. I pass it wildcards,
    like for instance *.txt. It shows all .txt files ok.

    However, if a user types in *.text and hits enter key,
    instead of re-populating the file list with files with
    the new user-specified extension, it closes and sends
    the appliction IDOK. Is there a special flag for this?

    I've not found a workaround... other apps don't do this,
    but then, they don't use MFC...

  2. Re: CFileDialog and wildcards

    roger@rogndeb.us (Roger Dunn) wrote in message news:<52961478.0401271310.736518db@posting.google.com>...
    > I'm using CFileDialog in MFC. I pass it wildcards,
    > like for instance *.txt. It shows all .txt files ok.
    >
    > However, if a user types in *.text and hits enter key,
    > instead of re-populating the file list with files with
    > the new user-specified extension, it closes and sends
    > the appliction IDOK. Is there a special flag for this?
    >
    > I've not found a workaround... other apps don't do this,
    > but then, they don't use MFC...


    The FindFile dialog is actually part of windows common controls, so I
    would guess that other (non-MFC) apps are using it also. Therefore,
    there's either a flag or two to control behaviour, or they're handling
    the return values differently.

    Sorry it's not a full answer, but the main point is that other apps
    are using the same control that you are (albeit with an MFC wrapper),
    so you should be able to create the same behaviour as they do.

    HTH

    Paul.

+ Reply to Thread