🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

changing icon file of program

Started by
3 comments, last by da_cobra 22 years, 8 months 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
Advertisement
Try chaging ICON_MAIN in the .rc file to "ICON_MAIN"
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