[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2264
  • Last Modified:

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?
0
jd9288
Asked:
jd9288
1 Solution
 
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 OlivaresCommented:
You can do it manually:
#define IDC_HAND MAKEINTRESOURCE(32649)
0
 
itsmeandnobodyelseCommented:
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
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now