For Programmers: Free Programming Magazines  


Home > Archive > MSDN > September 2005 > Documentation error in Platform SDK/SendInput









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Documentation error in Platform SDK/SendInput
Samuel Rydén

2005-09-04, 6:55 pm

Hi.

I believe I have found a documentation error at:
http://msdn.microsoft.com/library/d...tures/input.asp


Steps to reproduce:

#include <windows.h>
int main(int argc, char** argv)
{
INPUT mi[0];
mi[0].type = INPUT_MOUSE;
mi[0].mi.dx = 20;
SendInput(1, mi, sizeof(INPUT));
return 0;
}

Will produce compile error on "INPUT":
error C2065: 'INPUT' : undeclared identifier

As stated at http://www.codeguru.com/forum/archi.../t-221522.html,
you have to include "winable.h", not just windows.h, as stated in the MSDN
Library - which also seemed to solve my compile-time issues.

Running a Platform SDK less than 2 months old, VS 6.0, compiling a console
application, importing User32.lib

Am I right?


--


- Samuel


Jeff Partch [MVP]

2005-09-04, 6:55 pm

"Samuel Rydén" <trahojen_lots_of_spam@hotmail.com> wrote in message
news:%23LI7dYZsFHA.3604@tk2msftngp13.phx.gbl...
> Hi.
>
> I believe I have found a documentation error at:
>

http://msdn.microsoft.com/library/d...tures/input.asp
>
>
> Steps to reproduce:
>
> #include <windows.h>
> int main(int argc, char** argv)
> {
> INPUT mi[0];
> mi[0].type = INPUT_MOUSE;
> mi[0].mi.dx = 20;
> SendInput(1, mi, sizeof(INPUT));
> return 0;
> }
>
> Will produce compile error on "INPUT":
> error C2065: 'INPUT' : undeclared identifier
>
> As stated at

http://www.codeguru.com/forum/archi.../t-221522.html,
> you have to include "winable.h", not just windows.h, as stated in the MSDN
> Library - which also seemed to solve my compile-time issues.
>
> Running a Platform SDK less than 2 months old, VS 6.0, compiling a console
> application, importing User32.lib
>
> Am I right?


The prototypes, typedefs and #defines appear to be controlled by the
_WIN32_WINNT preprocessor symbol. In WinUser.h the value needs to be >
0x0400, in WinAble.h it uses < 0x0403. Comparing the versions of these
headers that I have, there are some differences in the struct declarations.
--
Jeff Partch [VC++ MVP]


Samuel Rydén

2005-09-05, 6:59 pm

"Jeff Partch [MVP]" <jeffp@mvps.org> skrev i meddelandet
> The prototypes, typedefs and #defines appear to be controlled by the
> _WIN32_WINNT preprocessor symbol. In WinUser.h the value needs to be >
> 0x0400, in WinAble.h it uses < 0x0403. Comparing the versions of these
> headers that I have, there are some differences in the struct

declarations.
> --
> Jeff Partch [VC++ MVP]
>
>


That explains what's going on. Thanks.
I still think it's curious, though, since the differences in these headers,
that I have now found myself also, seem to be of a GUI-related nature. I'm
running Win2000, SP4... it says I've got version 5.00.2195.

Does any of this make any sense to you? Because I'm completely lost now. :)


--


- Samuel


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com