Help!Replace mfc default icon
-
Hi, I am having problem replacing the default icon to my own in my SDI app. I have tried some of the following: 1) edit the code: CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CReminderAlarmDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CReminderAlarmView)); AddDocTemplate(pDocTemplate); replace 'IDR_MAINFRAME' to new icon id. Did not work. When running, I got message ' failed to create empty document'. 2) in devstudio resource editor, copy-paste the new icon into the IDR_MAINFRAME icon. Did not work. Still show the default icon. 3) open the .rc file in text mode, manually point the IDR_MAINFRAME to the new icon file, rather than the default. Still show the default icon. Note that I always do clean/rebuild all in case the image is still left in the exe file but still no luck. I think I also tried some other stuff but better not to go on. Eventually, (I do not remember what I did) the app suddenly is showing the right icon although the resolution is poor. However I could not reproduce the result. Can any big expert shed some light for me??? Very frustrated...
-
Hi, I am having problem replacing the default icon to my own in my SDI app. I have tried some of the following: 1) edit the code: CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CReminderAlarmDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CReminderAlarmView)); AddDocTemplate(pDocTemplate); replace 'IDR_MAINFRAME' to new icon id. Did not work. When running, I got message ' failed to create empty document'. 2) in devstudio resource editor, copy-paste the new icon into the IDR_MAINFRAME icon. Did not work. Still show the default icon. 3) open the .rc file in text mode, manually point the IDR_MAINFRAME to the new icon file, rather than the default. Still show the default icon. Note that I always do clean/rebuild all in case the image is still left in the exe file but still no luck. I think I also tried some other stuff but better not to go on. Eventually, (I do not remember what I did) the app suddenly is showing the right icon although the resolution is poor. However I could not reproduce the result. Can any big expert shed some light for me??? Very frustrated...
Using the resource editor (as you tried) you can replace the icon. Be sure to change both the 32x32 and 16x16 icons (selected from a combo box near the top of the resource editor). Good luck. Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
Hi, I am having problem replacing the default icon to my own in my SDI app. I have tried some of the following: 1) edit the code: CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CReminderAlarmDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CReminderAlarmView)); AddDocTemplate(pDocTemplate); replace 'IDR_MAINFRAME' to new icon id. Did not work. When running, I got message ' failed to create empty document'. 2) in devstudio resource editor, copy-paste the new icon into the IDR_MAINFRAME icon. Did not work. Still show the default icon. 3) open the .rc file in text mode, manually point the IDR_MAINFRAME to the new icon file, rather than the default. Still show the default icon. Note that I always do clean/rebuild all in case the image is still left in the exe file but still no luck. I think I also tried some other stuff but better not to go on. Eventually, (I do not remember what I did) the app suddenly is showing the right icon although the resolution is poor. However I could not reproduce the result. Can any big expert shed some light for me??? Very frustrated...
The best way that I've found to do this is to simply replace the .ico file with a new one, and then rebuild the project. Works every time.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb