Re: Isn't WHEEL_DELTA an identifier?
- From: Tim Roberts <timr@xxxxxxxxx>
- Date: Sat, 07 Jan 2006 23:40:27 -0800
"Robby" <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Thankyou for your post CARL:
>
>I have gone to your link and I see that there is a table of the prefered
>macros in use by header files. I currently have Windows XP S2 installed in my
>machine which coresponds to the following define statement in this table:
>
>NTDDI_VERSION >=NTDDI_WINXPSP2
>
>and the following table coresponds to the following:
>
>_WIN32_WINNT>=0x0501
>WINVER>=0x0501
>
>Now, when I right click on WHEEL_DELTA in my program it takes me to the
>following definition:
>
>#if(_WIN32_WINNT >= 0x0400)
>/* Value for rolling one detent */
>#define WHEEL_DELTA 120
>#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
>
>I don't know what to do.. do I have to change the 400 to 501? or is there a
>setting in the project properties I must change?
The SDK and compiler include files allow you to build programs for any
version of Windows. When you are building a program that you KNOW will be
run on Windows NT 3.51, for example, you want to make sure that you don't
call any APIs that were introduced after that. The include files help you
do that, using the _WIN32_WINNT symbol.
_WIN32_WINNT is a symbol defined by YOU in YOUR project settings (or YOUR
stdafx.h). When you set _WIN32_WINNT to 0x400, for example, you are saying
"I need this program to run on Windows NT 4.0, so please don't allow me to
call any XP-only APIs". If you do not define _WIN32_WINNT, the default
setting hides all of the APIs introduced after NT 3.51.
In your case, you are asking for an API that was introduced in NT 4.0.
Thus, you need to tell the compiler that you need those APIs. To do that,
you have to get _WIN32_WINNT defined to at least 0x0400. One way to do is
to add:
#define _WIN32_WINNT 0x0400
early in your stdafx.h. Another way is to add:
-D_WIN32_WINNT=0x0400
to your project settings.
The NTDDI_VERSION symbol is part of the DDK, not the SDK.
--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Re: Isn't WHEEL_DELTA an identifier?
- From: Carl Daniel [VC++ MVP]
- Re: Isn't WHEEL_DELTA an identifier?
- Prev by Date: Re: GetSaveFileName problem: can't get selected filter and put default name
- Next by Date: Re: Problem with wParam
- Previous by thread: Re: Isn't WHEEL_DELTA an identifier?
- Next by thread: Re: HELP / HELP / HELP !!!
- Index(es):
Relevant Pages
|