Issues getting "folder browse" button to appear on browse control

John Eskew 41 Reputation points
2020-12-31T14:36:51.627+00:00

Hello, and apologies if I've posted this to the wrong forum.

I'm attempting to add a "folder browse" button to a browse control on a dialog box, and while the button shows up in the resource manager, it does not show up when I attempt to run the program.

Here's what the resource manager shows for this particular EditBrowseCtrl. You can see that the "Browse Mode" option is set to "Folder Browse".
52613-image.png
And here's what the actual dialog box looks like when I run the program(no browse button):
52602-image.png
I've also tried to enable the folder browse button via the
EnableFolderBrowseButton
method, but the following just gives me a generic "encountered an improper argument" exception.

   CMFCEditBrowseCtrl* pEdit;  
   	pEdit = (CMFCEditBrowseCtrl*)GetDlgItem(IDC_MFCEDITBROWSE);  
   	pEdit->EnableFolderBrowseButton();  

Any help is greatly appreciated.

Developer technologies | C++
{count} votes

Accepted answer
  1. RLWA32 49,536 Reputation points
    2020-12-31T16:33:04.007+00:00

    One possibility is that the data needed to initialize the CMFCEditBrowseCtrl has been deleted from the application's .rc file.

    Check the .rc file that contains the resource statements for the dialog containing the control and make sure that it contains the initialization data that would look something like this -

    /////////////////////////////////////////////////////////////////////////////
    //
    // Dialog Info
    //
    
    IDD_TEST DLGINIT
    BEGIN
        IDC_MFCEDITBROWSE1, 0x37c, 42, 0
    0x4d3c, 0x4346, 0x6445, 0x7469, 0x7242, 0x776f, 0x6573, 0x4d5f, 0x646f, 
    0x3e65, 0x3c32, 0x4d2f, 0x4346, 0x6445, 0x7469, 0x7242, 0x776f, 0x6573, 
    0x4d5f, 0x646f, 0x3e65, 
        0
    END
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.