MFC EditBrowse Control for multi selection.

FAIZULLAH 21 Reputation points
2020-10-06T06:59:11.3+00:00

Hi.

I am quite new to MFC App designing. I want to develop a simple UI to open multiple files (images).

How can I enable EditBrowse control button for multiple files to get names of more than one files?

Thanks in advance.

Faizullah

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,413 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,849 questions
0 comments No comments
{count} votes

Accepted answer
  1. Guido Franzke 2,186 Reputation points
    2020-10-06T07:26:06.597+00:00

    Hello,
    as far as I know, the MFC EditBrowse Control only supports one file or one directory. There is no flag to enable multiple file selection.
    Read the documentation: cmfceditbrowsectrl-class
    You could for example use a listbox to show multiple files and a mfc browse control to add one more file to the listbox.
    Regards, Guido

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. P M Sherwood 6 Reputation points
    2021-11-24T06:18:06.86+00:00

    From the documentation for CMFCEditBrowseCtrl Class :

    void EnableFileBrowseButton(
        LPCTSTR lpszDefExt=NULL,
        LPCTSTR lpszFilter=NULL,
        DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT);
    

    Use this member function and include OFN_ALLOWMULTISELECT in the flags argument. It works just as in CFileDialog.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.