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
Solved

Changing an icon

Posted on 2004-09-03
4
179 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
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 63 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 62 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

856 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