Skip to main content
gamedev.net
🔒 Locked

Using resources - and a problem has risen!

Started by 1kevgriff 0 replies 200+ views
Original Post
1kevgriff
1kevgriff
I''ve been working on my first windows program. I''ve gotten the window on the screen so that part is over. Now, I am trying to add a custom icon and cursor to the program. I''m using VC6 so I am using the Resource Editor that comes with it. I created a icon and cursor: Icon 1 is called ICON_BIBLE Cursor 1 is called CUR_MAIN I go back to the wndclass declaration and make changes to it. Like so: winclass.hIcon = LoadIcon(hInstance, IDI_APPLICATION); winclass.hCursor = LoadCursor(hInstance, "CUR_MAIN"); winclass.hIconSm = LoadIcon(hInstance, "ICON_BIBLE"); I''ve also tried: winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); winclass.hCursor = LoadCursor(NULL, "CUR_MAIN"); winclass.hIconSm = LoadIcon(NULL, "ICON_BIBLE"); but neither work. I also adding #include "resource.h" to the program and it will compile fine, except for this little problem. Any suggestions would be great.
a38750
a38750
you need to use the MAKEINTRESOURCE macro like this:

LoadIcon(hInstance, MAKEINTRESOURCE(ICON_BIBLE));

hope that helps,
Frank

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.