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. Managed C++/CLI
  4. How do you change the Build Action property of an icon?

How do you change the Build Action property of an icon?

Scheduled Pinned Locked Moved Managed C++/CLI
visual-studiocsharpc++hardwarehelp
9 Posts 2 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.
  • B Offline
    B Offline
    BuckBrown
    wrote on last edited by
    #1

    Hi, I am using Visual Studio 2005 8.0 C++/CLI. I am getting a strange error when I try to set the Icon property of a Form. I can change the Icon property and compile but when I run the app it bombs on the line... this->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); I have read in forums that I need to change the Build Action property of the icon file to Embedded but I cant find any Build Action property. It seems my VS 2005 is different than other versions. Does anyone know the correct procedure to get this icon embedded into my solution/project? Thanks, Buck

    L 1 Reply Last reply
    0
    • B BuckBrown

      Hi, I am using Visual Studio 2005 8.0 C++/CLI. I am getting a strange error when I try to set the Icon property of a Form. I can change the Icon property and compile but when I run the app it bombs on the line... this->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); I have read in forums that I need to change the Build Action property of the icon file to Embedded but I cant find any Build Action property. It seems my VS 2005 is different than other versions. Does anyone know the correct procedure to get this icon embedded into my solution/project? Thanks, Buck

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      I'm using VS2005 Professional Project->Add->New Item (select Icon from the list) In Solution Explorer right click the Icon1.ico file and select "Properties" from the context menu. In the PropertyGrid there is a "Build Action" row.

      led mike

      B 1 Reply Last reply
      0
      • L led mike

        I'm using VS2005 Professional Project->Add->New Item (select Icon from the list) In Solution Explorer right click the Icon1.ico file and select "Properties" from the context menu. In the PropertyGrid there is a "Build Action" row.

        led mike

        B Offline
        B Offline
        BuckBrown
        wrote on last edited by
        #3

        Hi Mike, I'm also using VS 2005 Professional. I read your reply as "Click on Project, Click on Add, Click on New Item". If I click on Project the menu has 'Add Class', 'Add New Item', and 'Add Existing Item'. If I click on 'Add New Item' I get an 'Add New Item' dialog Box that has 'Categories:' and 'Templates:'. Under 'Categories:' I select 'Resource' where an 'Icon File (.ico)' template shows in the 'Templates:' window. I can select that and add it and it appears in the Solution Explorer in the Resources folder. In the Solution Explorer if I right click on the icon file and select Properties from the context menu I don't get a PropertyGrid, I get an icon.ico Property Pages dialog box that list 'Configuation Properties' and 'Custom Build Setup' in a tree structure (much like when I go to Solution/Properties or Project/Properties). This is so typical for me to have the odd flavor of a Microsoft product. What say you? Buck

        L 1 Reply Last reply
        0
        • B BuckBrown

          Hi Mike, I'm also using VS 2005 Professional. I read your reply as "Click on Project, Click on Add, Click on New Item". If I click on Project the menu has 'Add Class', 'Add New Item', and 'Add Existing Item'. If I click on 'Add New Item' I get an 'Add New Item' dialog Box that has 'Categories:' and 'Templates:'. Under 'Categories:' I select 'Resource' where an 'Icon File (.ico)' template shows in the 'Templates:' window. I can select that and add it and it appears in the Solution Explorer in the Resources folder. In the Solution Explorer if I right click on the icon file and select Properties from the context menu I don't get a PropertyGrid, I get an icon.ico Property Pages dialog box that list 'Configuation Properties' and 'Custom Build Setup' in a tree structure (much like when I go to Solution/Properties or Project/Properties). This is so typical for me to have the odd flavor of a Microsoft product. What say you? Buck

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          BuckBrown wrote:

          I get an 'Add New Item' dialog Box that has 'Categories:' and 'Templates:'. Under 'Categories:'

          Under Templates choose 'Icon File'

          led mike

          B 1 Reply Last reply
          0
          • L led mike

            BuckBrown wrote:

            I get an 'Add New Item' dialog Box that has 'Categories:' and 'Templates:'. Under 'Categories:'

            Under Templates choose 'Icon File'

            led mike

            B Offline
            B Offline
            BuckBrown
            wrote on last edited by
            #5

            The previous post was when I was within the project and I AM CHOOSING ICON FILE. If I highlight the Solution and select 'Add New Item' an 'Add New Item - Solution Items' dialog box appears and I can select 'Icon File' and add it to the 'Solution Items' folder. Right clicking on this icon file and selecting Properties now displays a PropertyGrid that has 5 properties listed... (name), Active Config, Description, Path, and Startup Project, but NO Build Action.

            L 1 Reply Last reply
            0
            • B BuckBrown

              The previous post was when I was within the project and I AM CHOOSING ICON FILE. If I highlight the Solution and select 'Add New Item' an 'Add New Item - Solution Items' dialog box appears and I can select 'Icon File' and add it to the 'Solution Items' folder. Right clicking on this icon file and selecting Properties now displays a PropertyGrid that has 5 properties listed... (name), Active Config, Description, Path, and Startup Project, but NO Build Action.

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              BuckBrown wrote:

              The previous post was when I was within the project and I AM CHOOSING ICON FILE.

              Yes that is correct.

              BuckBrown wrote:

              If I highlight the Solution

              Why did you switch to 'Solution'? Add the Icon File to the Project.

              led mike

              B 2 Replies Last reply
              0
              • L led mike

                BuckBrown wrote:

                The previous post was when I was within the project and I AM CHOOSING ICON FILE.

                Yes that is correct.

                BuckBrown wrote:

                If I highlight the Solution

                Why did you switch to 'Solution'? Add the Icon File to the Project.

                led mike

                B Offline
                B Offline
                BuckBrown
                wrote on last edited by
                #7

                I tried switching to solution because I have added the icon file to the project a half dozen times now. There simply is no Build Action property to be found.

                1 Reply Last reply
                0
                • L led mike

                  BuckBrown wrote:

                  The previous post was when I was within the project and I AM CHOOSING ICON FILE.

                  Yes that is correct.

                  BuckBrown wrote:

                  If I highlight the Solution

                  Why did you switch to 'Solution'? Add the Icon File to the Project.

                  led mike

                  B Offline
                  B Offline
                  BuckBrown
                  wrote on last edited by
                  #8

                  My full version number is 8.0.50727.42. I bet it does not match yours. Have a great Memorial Day weekend.

                  L 1 Reply Last reply
                  0
                  • B BuckBrown

                    My full version number is 8.0.50727.42. I bet it does not match yours. Have a great Memorial Day weekend.

                    L Offline
                    L Offline
                    led mike
                    wrote on last edited by
                    #9

                    BuckBrown wrote:

                    number is 8.0.50727.42. I bet it does not match yours.

                    It does match.

                    led mike

                    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