0

I've had a sudden surge of interest in an old (2007) program which is an MFC Dialog based app.

So I'd like to spruce it up a bit, and one of the annoying errors is that its proper icon does not appear in the bar at the bottom of Windows. A standard Windows icon appears, rather then the icon embedded in the EXE.

Anybody any idea what I am missing there?

If I build a test dialog based MFC project the icon is there, but all searches and comparison between the two
projects haven't helped me what is missing in my old project.... I've been comparing use of...

m_hIcon
IDR_MAINFRAME
IsIconic

etc. And the icon sizes, but no joy.

2
Contributors
1
Reply
3
Views
4 Years
Discussion Span
Last Post by ktsangop
0

Have you tried to open NameOfProject.rc file with a text editor to see its contents?
If no, this file usually reside to the NameOfProject\res\ directory.

Open it with notepad and search for IDR_MAINFRAME declaration.

There should be a line something like :

IDR_MAINFRAME           ICON    DISCARDABLE     "res\\NameOfProject.ico"

Also in the costructor of your main Dialog there should be a line like :

m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);

And finally there it should be defined in your resource.h file :

#define IDR_MAINFRAME                   128

I bet LoadIcon is not called, since on both of the other occasions you would have a compilation error or something..

Good luck!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.