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. The Lounge
  3. Why I love Windows programming

Why I love Windows programming

Scheduled Pinned Locked Moved The Lounge
helpvisual-studiocomdebuggingquestion
16 Posts 8 Posters 1 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 Luis Alonso Ramos

    What is the app icon? the one displayed on the main window? or the first icon which is displayed in Explorer and Start Menu? If you are talking about the Explorer icon, I'm not sure I think that the first icon specified in the resource file is the one taken by Explorer (first index.) So you might want to check the order of the icons in the .RC file. -- LuisR


    Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

    The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

    A Offline
    A Offline
    Alex Orovetskiy
    wrote on last edited by
    #7

    The one in the Explorer. And as I said IDR_MAINFRAME = 5 and I really don't remember anything defining itself as 1,2,3 or 4. But thank's for the heads up anyway. I didn't know that app icon should be the first one in resources. -------------------------------- Human stupidity is infinite.

    1 Reply Last reply
    0
    • A Alex Orovetskiy

      IDR_MAINFRAME is defined as 5 and I don't remember anything defined as 1-4 -------------------------------- Human stupidity is infinite.

      realJSOPR Offline
      realJSOPR Offline
      realJSOP
      wrote on last edited by
      #8

      I thought it was 128... ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

      A 1 Reply Last reply
      0
      • A Anna Jayne Metcalfe

        Always be careful when you add icon resources to a Windows executable, as by default the one with the lowest ID will be used for the app icon. Also remember that resource.h is marked as having "NO DEPENDENCIES". As a result, changing resources will not necessarily cause dependent files to be rebuilt, which can leave your build in an unpredictable state if you've been moving IDs around. For safety, always do a full rebuild after mucking about with resources. :rose: Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #9

        Anna-Jayne Metcalfe wrote:

        Also remember that resource.h is marked as having "NO DEPENDENCIES".

        Are you quite sure about that, as this has never given me a problem in the past, and I certainly never perform a full rebuild after changing resource.h. If I did, I would be wasting a great deal of time indeed - some of my projects take a long time to build! I just opened my most recent project (which is very resource heavy) in Visual Studio 2003 and resource.h is not marked with any special compiler flags. Hence, if it changes, then surely everything should build correctly?


        The Rob Blog
        Google Talk: robert.caldecott

        A 1 Reply Last reply
        0
        • L Lost User

          Anna-Jayne Metcalfe wrote:

          Also remember that resource.h is marked as having "NO DEPENDENCIES".

          Are you quite sure about that, as this has never given me a problem in the past, and I certainly never perform a full rebuild after changing resource.h. If I did, I would be wasting a great deal of time indeed - some of my projects take a long time to build! I just opened my most recent project (which is very resource heavy) in Visual Studio 2003 and resource.h is not marked with any special compiler flags. Hence, if it changes, then surely everything should build correctly?


          The Rob Blog
          Google Talk: robert.caldecott

          A Offline
          A Offline
          Alex Orovetskiy
          wrote on last edited by
          #10

          Yes, that fact is quite true. Try compiling a project, than change something in resource.h and compile again. It won't actually start compiling but execute already compiled app. I hope all above made any sense :P -------------------------------- Human stupidity is infinite.

          L 1 Reply Last reply
          0
          • A Alex Orovetskiy

            Yes, that fact is quite true. Try compiling a project, than change something in resource.h and compile again. It won't actually start compiling but execute already compiled app. I hope all above made any sense :P -------------------------------- Human stupidity is infinite.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #11

            Woah. So it does. I stand corrected! That's mad... I am amazed this has never bitten me on the backside before. So what does the resource editor to differently, as if you add/edit resources using the visual editor, then the project builds correctly...


            The Rob Blog
            Google Talk: robert.caldecott

            A 1 Reply Last reply
            0
            • M Maximilien

              Anna-Jayne Metcalfe wrote:

              Also remember that resource.h is marked as having "NO DEPENDENCIES". As a result, changing resources will not necessarily cause dependent files to be rebuilt, which can leave your build in an unpredictable state if you've been moving IDs around.

              so that's the freaking reason why I always have to rebuild everything when modifying the resource.h file ! Is here a way ( in vs.net 2003 ) to change that behaviour ?


              Maximilien Lincourt Your Head A Splode - Strong Bad

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #12

              I have just been looking at this, and the MSDN says: "Visual C++ always adds the //{{NO_DEPENDENCIES}} comment line to a .RC file when it saves the file. In some cases, circumventing of the build dependency on RESOURCE.H may lead to run-time errors undetected at link time. For example, if you use the Symbol Browser to change the numeric value assigned to a symbol for a resource, the resource will not be correctly found and loaded at application run-time if the .CPP file referring to the resource is not recompiled. In such cases, you should explicitly recompile any .CPP files that you know are affected by the symbol changes in RESOURCE.H or select Rebuild All. If you have the need to frequently change symbol values for a certain group of resources, you will probably find it more convenient and safer to break out these symbols into a separate read-only header file, as described in the above section Including Additional Header Files."


              The Rob Blog
              Google Talk: robert.caldecott

              1 Reply Last reply
              0
              • A Alex Orovetskiy

                Yesterday I was putting finishing touches on updating my System Scanner (a little advertisment will never hurt :p) app and added a new icon resource to it. Suddenly my app icon has changed to this newly added resource. I haven't changed a thing except using Insert resouce in Resource editor. ID was IDR_ICON1. I tried looking everywhere with no result. App icon was still the one in IDR_ICON1, not IDR_MAINFRAME. I added a new icon resource (IDR_ICON2) and nothing changed. App icon was still IDR_ICON1. So I deleted IDR_ICON2 and closed VS in frustration. I decided to try and figure what the problem was today, opened VS and found out...that my app icon was IDR_MAINFRAME. I've deleted debug dir, rebuilt the project and it still was IDR_MAINFRAME ! Now could somebody explain me the paranormal nature of this self-appearing and self-dissapearing bug ? NOTE: Not a single line of code, not even a comma was changed manually during icon addition and removal. -------------------------------- Human stupidity is infinite.

                N Offline
                N Offline
                Nitron
                wrote on last edited by
                #13

                What version of VS were you using? I know VS6 stores resources in a database (*.ncb/ *.aps/*.opt or one of those) Sometimes the version in the database will replace the resource file... (i've had that happen many a time) If you delete your ncb and others, as well as delete your debug folder, then it will have to rebuild the db and will load the info from the referenced files... ~Nitron.


                ññòòïðïðB A
                start

                A 1 Reply Last reply
                0
                • realJSOPR realJSOP

                  I thought it was 128... ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                  A Offline
                  A Offline
                  Alex Orovetskiy
                  wrote on last edited by
                  #14

                  I've set it to 5 for some reason some time ago. Probably something else was defined as 5 and I wanted my icon on top of the list :) -------------------------------- Human stupidity is infinite.

                  1 Reply Last reply
                  0
                  • N Nitron

                    What version of VS were you using? I know VS6 stores resources in a database (*.ncb/ *.aps/*.opt or one of those) Sometimes the version in the database will replace the resource file... (i've had that happen many a time) If you delete your ncb and others, as well as delete your debug folder, then it will have to rebuild the db and will load the info from the referenced files... ~Nitron.


                    ññòòïðïðB A
                    start

                    A Offline
                    A Offline
                    Alex Orovetskiy
                    wrote on last edited by
                    #15

                    I'm using 7.1 I'm guessing this was some wild bug which probably involved redefining my resources. -------------------------------- Human stupidity is infinite.

                    1 Reply Last reply
                    0
                    • L Lost User

                      Woah. So it does. I stand corrected! That's mad... I am amazed this has never bitten me on the backside before. So what does the resource editor to differently, as if you add/edit resources using the visual editor, then the project builds correctly...


                      The Rob Blog
                      Google Talk: robert.caldecott

                      A Offline
                      A Offline
                      Anna Jayne Metcalfe
                      wrote on last edited by
                      #16

                      Crazy isn't it? I think they've done it that way because AppWizard generated apps effectively include resource.h in every file - so every time you added a control to a dialog (for example) it would spark a full rebuild. The resource editor gets away with it only because most of the time when editing resources you are also working on the corresponding code. That code gets recompiled because its been modified, not because of the resource ID change. For instant fun (not!), swap around the IDs of the dialog templates in your app and do an incremental build. Then run it.... Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                      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