I am using Visual C++ 2005 Express which doesn't allow resource editing. When I create a wxWidgets project, it never even creates a rc or res file to edit.
So I am trying to use the SetIcon function on my frame and the compiler never gives any errors, but it also never shows an icon in my title bar and task bar.
Does anyone have any ideas on how I can get an app icon to display?
Problems setting an app icon Topic is solved
-
- Earned some good credits
- Posts: 102
- Joined: Thu Dec 28, 2006 5:12 pm
- Location: Indiana, US
I'm using Visual C++ 2003, not 2005, but what I did was create
a .rc file with same name as solution and put this inside:
then in the frame constructor, used this code
Is that what you tried?
I also added the .rc file to my solution.
a .rc file with same name as solution and put this inside:
Code: Select all
anIcon ICON klp.ico
#include "wx\msw\wx.rc"
Code: Select all
frame->SetIcon(wxICON(anIcon));
I also added the .rc file to my solution.
-
- Earned some good credits
- Posts: 102
- Joined: Thu Dec 28, 2006 5:12 pm
- Location: Indiana, US
-
- Earned some good credits
- Posts: 102
- Joined: Thu Dec 28, 2006 5:12 pm
- Location: Indiana, US
Ok, I'll try that. But I don't have any experience with rc files, so I have a couple of questions for you.
Where you entered klp.ico, should I substitute the name of the file I want to use, or does it need to say klp.ico?
Can I make the rc file with only those two lines, or does it need to have more things in it?
If I just save this file to my project's directory, will it automatically be added to the project? edit: I actually just tried it, and it doesn't add it automatically. In the Express version, I can't even figure out how to add an rc file.
Thanks again.
Where you entered klp.ico, should I substitute the name of the file I want to use, or does it need to say klp.ico?
Can I make the rc file with only those two lines, or does it need to have more things in it?
If I just save this file to my project's directory, will it automatically be added to the project? edit: I actually just tried it, and it doesn't add it automatically. In the Express version, I can't even figure out how to add an rc file.
Thanks again.
A small piece of additional information, if your icon still does not show up, rename it to AAAAAAAAAAAAA as constant. Somehow Windows takes the first icon in the resource (with the first alphabetic name) to be the icon name for the main window.
Regards.
- Jorgen
Regards.
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Yes, change klp.ico to your file name. Those are the only 2 lines in my .rc file.forrestcupp wrote:Ok, I'll try that. But I don't have any experience with rc files, so I have a couple of questions for you.
Where you entered klp.ico, should I substitute the name of the file I want to use, or does it need to say klp.ico?
Can I make the rc file with only those two lines, or does it need to have more things in it?
If I just save this file to my project's directory, will it automatically be added to the project? edit: I actually just tried it, and it doesn't add it automatically. In the Express version, I can't even figure out how to add an rc file.
Thanks again.
In Visual C++, I believe I just right-clicked on the project in the browser and did an "Add existing ..."
If you still have trouble, check this link.
http://www.gamedev.net/community/forums ... _id=457396
there seem to be some links to resource editors there. I haven't tried any of them though.
http://www.gamedev.net/community/forums ... _id=457396
there seem to be some links to resource editors there. I haven't tried any of them though.
-
- Earned some good credits
- Posts: 102
- Joined: Thu Dec 28, 2006 5:12 pm
- Location: Indiana, US
Thanks! You're awesome. I didn't realize I could add an existing item and it would accept an rc file. I created an rc file using notepad and I substituted my icon file for what you had, and it worked.timg wrote:
Yes, change klp.ico to your file name. Those are the only 2 lines in my .rc file.
In Visual C++, I believe I just right-clicked on the project in the browser and did an "Add existing ..."
Thank you.
Edit:
Just for future reference, I have to do this, which is slightly different from what I was told.
Code: Select all
frame->SetIcon(wxIcon(_T("anIcon")));