visual studio – MFC EditBrowse control does not display the folder icon at runtime


I have a dialog type application that includes a MFC EditBrowse Control. This control includes a folder/magnifier icon on the right side where the user is supposed to click to bring up a folder browser pop-up.

screen grab of what it should look like

That folder/magnifier icon displays properly in the dialog editor within Visual Studio, but at runtime it displays as a plain flat button. It behaves properly otherwise – that is, the browser pop-up pops up and the selected folder is displayed when the user clicks OK.

When run with the debugger a message is displayed in the VS Output Window saying “Can’t load bitmap: 4299”. That message is displayed after the CDialogEx::OnInitDialog() line within my OnInitDialog().

I’ve written test programs and they display the icon properly. I’ve also added additional EditBrowse controls in my original program, but they experience the same problem and just add another line of “can’t load bitmap”. I’ve also added other MFC controls and some of them also do not display their icons (or other stuff).

I’ve managed to affect the problem slightly by making calls to EnableBrowseButton() and EnableFolderBrowswButton() from my OnInitDialog. If I do that, I get an icon that looks like 3 horizontal dots:

enter image description here

which is better, but I’d prefer the folder/magnifier icon.

It’s a complicated enough application I’d rather not re-write it from the beginning and furthermore I’d like to understand what is going on. I’m fairly certain this is a result of adding/deleting controls as the app was developed, but don’t have a good idea on where to begin tracking down where things went awry.

Thoughts on how to debug this? BTW, this is VS 2010.

Leave a Reply

Your email address will not be published. Required fields are marked *