How to I specify what icon resource to tie to my executable?

I have an app in MSVC++ v6 and somethings gone a bit loopy, because although I edited the icon, the executable is still using the default MFC icon.

How do I fix this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The icon with the lowest ID in the resource is the application icon. After editing and saving, take a look at the res directory to make sure the icon has changed, then rebuild the project.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jhattinghAuthor Commented:
Thanks for your response:

The icon *is* changed when I edit it, but it is not showing as the executable's icon when I compile...

The icon is IDR_MAINFRAME, Following is my resource.h:

// Microsoft Developer Studio generated include file.
// Used by WinLurk.rc
#define IDD_WINLURK_DIALOG              102
#define IDR_MAINFRAME                   128
#define IDI_MAG_GLASS_BLANK             130
#define IDD_DIALOG1                     129
#define IDD_ABOUTBOX                    130
#define IDB_BITMAP_ABOUT                131
#define IDD_DIALOG_WIZARD1              133
#define IDD_DIALOG_WIZARD2              134
#define IDI_WAIT                        135
#define IDD_DIALOG_WIZARD3              135
#define IDI_GO                          136
#define IDD_DIALOG_WIZARD4              136
#define IDB_BITMAP_GWINLURK             137
#define IDC_MAG_GLASS                   140
#define IDI_MAG_GLASS                   141
#define IDC_STATIC_CLASSNAME            1000
#define IDC_STATIC_WINDOWTEXT           1001
#define IDC_STC_MAG_GLASS               1002
#define IDC_STATIC_WINDOWSIZE           1003
#define IDC_STC_READY                   1004
#define IDC_CHECK_SIZE_REQUIRED         1005
#define IDC_STATIC_CONTROLID            1006
#define IDC_BTN_ALWAYS_ON_TOP           1007
#define IDC_BUTTON_SAVE                 1007
#define IDC_STATIC_WINDOW_TEXT          1009
#define IDC_STATIC_WINDOW_CLASS         1010
#define IDC_STATIC_WINDOW_SIZE          1011
#define IDC_STATIC_BUTTON_TEXT          1012
#define IDC_CHECK_TERMINATE             1014
#define IDC_CHECK_INDEFINITE            1016
#define IDC_EDIT_SECONDS                1017
#define IDC_STATIC_DONE                 1018

// Next default values for new objects
#define _APS_NEXT_RESOURCE_VALUE        138
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1019
#define _APS_NEXT_SYMED_VALUE           101
I would suggest you use Visual C++ to open the .exe file as a resource to see what is inside.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

jhattinghAuthor Commented:
Ok - I did that and the lowest number assigned to an icon was shown as the icon I intended to be the executable's resource, but still the exe has the MFC icon... odd.

Hey i'll give you a clue as to what might be wrong - I remembered that this started playing up when I cut and pasted other icon resources from another project I imported into my workspace. That probably started interfering with the sequence... :)
Another thing you should note is that the MFC icon has two version inside, one is the large icon (Standard 32x32), another is the small icon (Small 16x16). Maybe you have changed only one of them. Open the icon with the Resource Editor.
jhattinghAuthor Commented:
I have cheked this... Both versions exist and have been modified.

Still not appearing as exe's icon. :(

Let me take a look if you can send the project to
jhattinghAuthor Commented:
What a pain! I've transferred the file(s) to a different computer and the icon is OK!! There must be something up with the PC. Sorry it's been more of a hassle than it should have been.

I will accept the your proposed answer shortly...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.