Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help!Replace mfc default icon

Help!Replace mfc default icon

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++questionlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Laffis
    wrote on last edited by
    #1

    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...

    K D 2 Replies Last reply
    0
    • L Laffis

      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...

      K Offline
      K Offline
      krmed
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • L Laffis

        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...

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups