Advertisement

changing icon file of program

Started by October 25, 2001 12:47 PM
3 comments, last by da_cobra 23 years, 1 month ago
I just completed my first window tutorial and everything works fine, but now I just want to change my icon I created a .rc file with ICON_MAIN ICON "cobra.ico" (icon file is in same directory as .rc and .cpp files) now I changed a line in my winapi winmain() sampleclass.hIcon = LoadIcon(hinstance, "ICON_MAIN") ; and I added that rc file to my project (I use vc++) now I get a linker error LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup Debug/cobra window.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. and yes I use a win32 application and not a console thanx in advance for any advice Da cobra
Try chaging ICON_MAIN in the .rc file to "ICON_MAIN"
Advertisement
nope that doesn''t work either

any other thoughts?

pls.....
I haven''t done Win32 in a long, long time, but 1) include resource.h (or however it''s called) and 2) try it like this :

sampleclass.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(ICON_MAIN));

Once again, I haven''t done Win32 in a long, long time.

Hope this helps.
already tried that

but thanx anyway for your reply

This topic is closed to new replies.

Advertisement