Jump to content
• Advertisement

Public Group

Resource file trouble

This topic is 4631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here again. Feels like i'm asking too much, but I have no choice when i'm following the steps completely right and some things still doesn't work even though I know i'm doing it right. I'm creating a basic window with a custom cursor and icon, there were errors in the beginning when I had this code: The .rc file
[SOURCE]
CROSSHAIR_CURSOR CURSOR crosshair.cur
COLOR_ICON ICON color.ico
[/SOURCE]
resource.h
[SOURCE]
#define CROSSHAIR_CURSOR 100
#define COLOR_ICON 200
[/SOURCE]
and then it's the windows class: winclass.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(COLOR_ICON)); winclass.hCursor = LoadCursor(hinstance, MAKEINTRESOURCE(CROSSHAIR_CURSOR)); When I try to compile the resoure file it says it doesn't find the .ico and .cur file even though they are in the same directory. That problem was solved by making a folder in c: and refer to that folder like this: the .rc file
[SOURCE]
CROSSHAIR_CURSOR CURSOR c:\icons\crosshair.cur
COLOR_ICON ICON c:\icons\color.ico
[/SOURCE]
It should work if it's in the same folder! But there are still problems, only the icon works now, the cursor just loads and doesn't show. I gave up after an hour or two it was hopeless. Now when i'm here again I used the string method instead like this: the .rc file
[SOURCE]
CROSSHAIR_CURSOR CURSOR c:\icons\crosshair.cur
COLOR_ICON ICON c:\icons\color.ico
[/SOURCE]
the windows class fields: winclass.hIcon = LoadIcon(hinstance, "COLOR_ICON"); winclass.hCursor = LoadCursor(hinstance, "CROSSHAIR_CURSOR"); This worked just fine, no errors, it showed the cursor, and the icon like it should. But I still can't have the .ico and the .cur file in the same directory, I most copy it to the icons folder in c: else it won't find the files, that's just illogical and annoying error that shouldn't exist. I want to add that microsoft visual c++ is a really bad compilator it's only useful for creating icons and cursors. It always comes with compile errors for source code that works everywhere else, on top of that it's much harder and slowers to use, it's getting on my nerves, that compilator doesn't just make any sense. Using dev c++ mostly.

Share this post

Share on other sites
Advertisement

• Advertisement
• Advertisement

• Popular Contributors

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5
• Advertisement

• 28
• 40
• 23
• 13
• 13
• Forum Statistics

• Total Topics
631737
• Total Posts
3001949
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!