?
Solved

Changing an icon

Posted on 2004-09-03
4
Medium Priority
?
185 Views
Last Modified: 2010-04-01
I'd like to change the icon both of the application and of the individual forms (the small icon which appears at the upper left corner of the forms).

I was able to change the icon of the application by replacing the default app.ico with a custom made one. Unfortunately, this doesn't replace the small icons which appear on the upper left corner of the form. When I try to change the icon in the property sheet the following error appears upon compilation:

error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager'

To avoid the above error in changing these small icons I wrote the following code into the constructor:

                System::Drawing::Icon *IC = new System::Drawing::Icon("app.ico");
              this->Icon = IC;

Interestingly, this compiles well despite the following error appearing in the task list:

               'The variable 'IC' is either undeclared or was never assigned.'

What is even worse, I can't get the compiled .exe file to work. How is this problem fixed?
0
Comment
Question by:judico
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 252 total points
ID: 11973030
You ca change all the icons for your app. Just go to resource editor and chnge from there. Be aware that are more icon types (16x16, 32x32, etc) with different number of colors (16, 256, etc).

>I was able to change the icon of the application by replacing the default app.ico with a custom made one
I suppose you changed with an icon file containing onl a 32x32 icon, not 16x16 and the rest
0
 
LVL 8

Assisted Solution

by:pjcrooks2000
pjcrooks2000 earned 248 total points
ID: 11973451
Yes add it through the resource editor to your project then change the name for it wherever you it has been declared in the main app.

This link should put your rignt on the right tract you need to go down
http://www.codeproject.com/gdi/replaceicon.asp

good luck with it

pjcrooks2000
0
 

Author Comment

by:judico
ID: 11979541
Thank you for the help. One crucial line which should also be added to the code is:

#undef GetObject

For more details please take a look at:

http://www.dotnet247.com/247reference/msgs/36/184054.aspx
0
 
LVL 8

Expert Comment

by:pjcrooks2000
ID: 11979880
thanks judico good luck to you for the future, i am glad we helped you

pjcrooks2000
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question