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.

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.