compiler error C2065: 'IDC_HAND' : undeclared identifier

I'm getting this error in LoadCursor(NULL, IDC_HAND); even tho <windows.h> is included, and
User32.lib is referenced.
What am I missing?
jd9288Asked:
Who is Participating?
 
itsmeandnobodyelseConnect With a Mentor Commented:
Its defined in winuser.h

#if(WINVER >= 0x0500)
#define IDC_HAND            MAKEINTRESOURCE(32649)
#endif /* WINVER >= 0x0500 */

but available only for NT 5.0 and higher (W2k or WXP). If you have such a system you should set WINVER to 0x0500 in the project settings  (C++-Tab, Preprocessor Settings: add ,WINVER=0x0500)

Regards, Alex
0
 
SteHCommented:
This is pure Win API and no MFC?

windows.h has several ifdef cases. Depending on what is defined before it might not be included by the compiler.
When using MS studio you can right click on IDC_HAND and select "go to definition ...". If it is correctly included you will be brought to the line in windows.h else nothing happens. In that case you need to have a look at project settings.
0
 
Jaime OlivaresSoftware ArchitectCommented:
You can do it manually:
#define IDC_HAND MAKEINTRESOURCE(32649)
0
 
jd9288Author Commented:
Setting WINVER actually worked!
0
 
itsmeandnobodyelseCommented:
Wow! You have been very fast. Three minutes to test, accept and give points.

Don't forget to set WINVER in Release Settings also.

Thank's for the points.

Regards, Alex

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.