Here is the snippet of code that includes hidsdi which in turn includes hidpi:
#ifdef _MSC_VER
# pragma warning(disable: 4530)
# pragma comment(lib, "setupapi.lib")
# pragma comment(lib, "hid.lib") // for HID API (from DDK)
# pragma comment(lib, "winmm.lib") // for timeGetTime()
#endif // _MSC_VER
#include "wiimote.h"
#include <sys/types.h> // for _stat
#include <sys/stat.h> // "
#include <process.h> // for _beginthreadex()
#include <wtypes.h>
#include <setupapi.h>
extern "C" {
# ifdef __MINGW32__
# include <ddk/hidsdi.h>// from WinDDK
# else
#include <api/hidsdi.h>
# endif
}
ive tried <api/hidsdi.h> in and out of the extern "C" but it made no
difference, in the original demo code the code was within the extern.
some of the errors include:
Error 1 error C2065: 'PASSIVE_LEVEL' : undeclared identifier
c:\winddk\7600.16385.0\inc\api\hidpi.h 304
Error 2 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 3 error C2146: syntax error : missing ';' before identifier
'NTSTATUS' c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 4 error C2143: syntax error : missing ';' before '__stdcall'
c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 5 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 6 error C2377: 'NTSTATUS' : redefinition; typedef cannot be
overloaded with any other symbol c:\winddk\7600.16385.0\inc\api\hidpi.h
305
Error 7 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 309
Error 8 error C2065: 'DISPATCH_LEVEL' : undeclared identifier
c:\winddk\7600.16385.0\inc\api\hidpi.h 325
and they are all very similar, to me it would seem like there is a header
not being included that should be as all the problems seem to stem from
undefined symbols. however i can't seem to find any information on msdn or in
the WDK documentation that is a relevant information in how hidsdi / hidpi
should be set up and frankly ive been going round in circles and going slowly
insane for the past few hours and im hoping someone can help or give me a
push in the right direction! Thank you in advance for any help you can give
me!
p.s. this post has been moved from
http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/9aa7cb30-9a96-4fb5-9b3d-427e73159cce/
WDK version 7600.16385.0
Windows 7 SDK (v7.0)
Visual Studio 2008 (haven't tried Express yet)
Used Jan Axelson's code (usbhidioc)
Ordered and added include files as instructed in gamedev.net. (SDK first and
WDK last)
I didn't add any headers like wdm.h or otherwise to the code, and I didn't
find success until I added the C:\WinDDK\7600.16385.0\lib\wxp\i386 to the end
of VC++ directories->Library Files. I'm assuming that the directory you
choose will be related to OS, as I am building for XP, I used wxp.
I hope this helps you and anybody else struggling with this issue.
-Chris
#include <sal.h> //
-------------------------------------------------------------
#include <sal_supp.h> // These header files just define unimportant macros
in hidsdi.h
#include <driverspecs.h> //
-------------------------------------------------------------
#include <windows.h> // Must be defined before hidsdi.h and setupapi.h
#if defined(__cplusplus)
extern "C" // Just formal requirement
{
#endif
#include <hidsdi.h>
#if defined(__cplusplus)
}
#endif
#include <setupapi.h>
-----------------------------------------------------------------------
Sanje2v
Can you post a link to download this sdk?