Menu

How can I define an Icon and used in source?

Hui Zhao
2007-12-21
2012-09-26
  • Hui Zhao

    Hui Zhao - 2007-12-21

    Dear all:

    I am an chinese, and living in MainLand(PRC). I don't know the the file type that end with RC.
    what does this soucre means? see as below.

    IDI_BLIZZARD ICON "Res\Blizzard.ico"
    IDI_BLIZZARD_SM ICON "Res\Blizzard_sm.ico"

    I can comple a project,but the programe does not load the icon.what can I do?

    Thanks a lot.
    Happy new year! thanks a lot.

     
    • Hui Zhao

      Hui Zhao - 2007-12-23

      Thank you , andybuonviri, two icon file have exist on F disc,,and my project establish on c disc.

      Can give this statement a path? such as below:

      IDI_BLIZZARD       ICON "F:\book\example\Chap02\Blizzard\Res\\Blizzard.ico"
      IDI_BLIZZARD_SM    ICON "F:\book\example\Chap02\Blizzard\Res\\Blizzard_sm.ico"
      

      Thanks a lot, marry christmas!

      Hi: aajmillan:

      as your suggeste, I don't know How to using these symbols "//,\\"  can you take me an example for this.
      

      my system is Vista ,I use Dev C++ 4.9.9.2 to learning program.

      when I compile thoes source ,and then an error occure :

      installtion problem: cannot exec 'cc1':no such file or directory
      [Resource error] no Resource
      [Build error][blizzard_private.res]Error 1.
      

      Thanks a lot marry Christmas.

      these source is an explam of book named Geginning Game programming, write by Michael Morrison. Thanks for visit this information

       
      • Osito

        Osito - 2007-12-23

        Yes you can give it a path. Your original example had a relative path (Res\...) and you can have a full path as well. You need double-slashes because it will be interpreted as a string and '\' is the escape character. So for instance you would use:

        IDI_BLIZZARD ICON "F:\book\example\Chap02\Blizzard\Res\Blizzard.ico"

        The suggestion by ajmillan was simply a way to avoid the need for double-slashes. Using the forward slash, which is not a special character in a string, will work as well, as in his example. You can use any of the three options: single forward slash, double backslash, double forward slash.

        If you are getting the cc1 not found error then I think you might have a Vista problem, which is explained in the "please read before posting" thread.

         
    • Osito

      Osito - 2007-12-22

      RC is a file containing Windows resources. The two lines you posted are icons to be included in the project. Do those files exist? Are the icons valid?

       
    • Anonymous

      Anonymous - 2007-12-22

      Supposedly to define an icon in a .RC file you need some as:

      IDI_BLIZZARD ICON "Res/Blizzard.ico" // OR \ if you prefer
      IDI_BLIZZARD_SM ICON ICON "Res/Blizzard_sm.ico"

      Later, you need "load" the icon and put it any where.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.