CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Location
    Yerevan, Armenia
    Posts
    37

    [RESOLVED] Set icon at build time

    Hello.
    I have a small MFC dialog based application. Also I have a some resources (some icons). I want my application to have different icons for different builds (release and debug). For example I have two icons, debug.ico and release.ico. If I build my application in release configuration, I want to have release.ico as my application icon ( by "application icon" I mean icon visible from explorer.exe). If I build with debug config, to have debug.ico as application icon. I'm using Visual Studio.

    Is it possible to do this?
    How can I affect build process?

    Thank you...

  2. #2
    Join Date
    Aug 2008
    Location
    Scotland
    Posts
    379

    Re: Set icon at build time

    Hi,

    Windows will use the lowest numbered icon resource, so in your .rc file try this:

    Code:
    #ifdef _DEBUG
    0  ICON   "res\\debug.ico"
    #else
    0 ICON "res\\release.ico"
    #endif

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured