Application Icon in Windows Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

Application Icon in Windows

Post by kea_ » Thu Sep 10, 2009 5:59 am

Hello together,

I try to set a icon (.ico) for my Windows-Application.
I have read the tutorials but get everytime an error.

this is my .rc file:

Code: Select all

aaaa ICON "wx/msw/std.ico"

#include "wx/msw/wx.rc"
this the frame file

Code: Select all

fmMyEnduranceDiary::fmMyEnduranceDiary(csConfig *cfg, csDatabase *db)
                  : wxFrame(NULL, ID_DUMMY_VALUE, S_APPLICATION, wxDefaultPosition, wxSize(cfg->GetLongValue("fmMyEnduranceDiary.Size.Width", 1100), cfg->GetLongValue("fmMyEnduranceDiary.Size.Height", 750)), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE){
    SetIcon(wxICON(aaaa));
And this is the error:

Code: Select all

resource.rc:1: error: `aaaa' does not name a type
Has any body an idea?

Thanks kea_

schmmichael
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jan 19, 2007 10:38 am
Location: Switzerland

Post by schmmichael » Thu Sep 10, 2009 6:07 am

Hi

I'm also using icons on windwos applications.
I can't read if you create the object file or not.
So if you forgot it, do following to test it:

copy the icon in your application directory, change the path in the ressource file. Then run in the command line
"windres --use-temp-file -iaaaa.rc -oaaaa_rc.o" (without quotation marks). So you will get a file aaaa_rc.o.
Include this in your linker path and it should work.

good luck

kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

Post by kea_ » Thu Sep 10, 2009 6:26 am

Thank you for your answer.

I solved the problem. I included the .ico (#include "bla.ico") thats wrong.
Now it works.

Greetings kea_

Post Reply