Solved

Changing an icon

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

707 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

13 Experts available now in Live!

Get 1:1 Help Now