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?
LVL 1
jhattinghAsked:
Who is Participating?
 
chensuConnect With a Mentor Commented:
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.
0
 
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:

//{{NO_DEPENDENCIES}}
// 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
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        138
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1019
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
0
 
chensuCommented:
I would suggest you use Visual C++ to open the .exe file as a resource to see what is inside.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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... :)
0
 
chensuCommented:
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.
0
 
jhattinghAuthor Commented:
I have cheked this... Both versions exist and have been modified.

Still not appearing as exe's icon. :(

Thanks
0
 
chensuCommented:
Let me take a look if you can send the project to chensu@hotmail.com.
0
 
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...
0
All Courses

From novice to tech pro — start learning today.