Q: Loading Custom Cursors in MS Visual C++

Started by
1 comment, last by GameDev.net 24 years, 5 months ago
The most obvious problem is that you need to specify the hInstance paramater on the LoadCursor call.

It's not good form to call functions without checking results too. You should make it 2 separate calls, checking the results of each.

------------------

-Kentamanos

-Kentamanos
Advertisement
I am having trouble loading custom cursors into my C++ app. I can get the standard cursors to load by calling:

SetCursor(LoadCursor(NULL, IDC_UPARROW));

...but I can't get the custom cursor I created in the resource editor to load.

My custom cursor is associated with the constant IDC_CURSOR4. It shows up in my cursor resources list but it no cursor is shown when I do the following call:

SetCursor( LoadCursor(NULL, IDC_CURSOR4));

I really appreciate any help you wizards can give me as I've poured through all my books and can't get it to work.

As a favor can you please email me your replies to:

Glenn_Whiting@cc.chiron.com

Thanks!

Ok, first of all, you should do what you already did

WndCls.hCursor = LoadCursor(NULL, IDC_WHATEVER_IT_IS_CALLED);

and in your resource file you should have

IDC_WHATEVER_IT_IS_CALLED ICON MyOwnDamnedFuckingGoodLooking.ico

ie. the filename.....

------------------
Dance with me......

This topic is closed to new replies.

Advertisement