How do you change the Build Action property of an icon?
-
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
-
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
-
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
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
-
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
-
BuckBrown wrote:
I get an 'Add New Item' dialog Box that has 'Categories:' and 'Templates:'. Under 'Categories:'
Under Templates choose 'Icon File'
led mike
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.
-
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.
-
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
-
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
-
My full version number is 8.0.50727.42. I bet it does not match yours. Have a great Memorial Day weekend.