Solved

Changing an icon

Posted on 2004-09-03
4
178 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MSVCR80.dll crash 2 138
Focus not getting shifted out of  editbox 2 62
Socket Programming (Unix) 8 125
thread-safe code in c++ 2 98
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now