Hi, I'm trying to read from an USB HID device, I know how to do it in C# using DLLImport hid.dll, but I want to do it from C++, this way I don't have to declare all the structures, etc, and just include the headers files.
So I downloaded the WDK and then when including the headers files and linking the libraries I'm getting a lot of errors:
#include <windows.h>
extern "C" {
#include <hidsdi.h>
}
int main(){
}
Errors (6 out of 163):
Error 1 error C2065: 'PASSIVE_LEVEL' : undeclared identifier c:\winddk\7600.16385.1\inc\api\hidpi.h 302 driver
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.1\inc\api\hidpi.h 303 driver
Error 3 error C2146: syntax error : missing ';' before identifier 'NTSTATUS' c:\winddk\7600.16385.1\inc\api\hidpi.h 303 driver
Error 4 error C2143: syntax error : missing ';' before '__stdcall' c:\winddk\7600.16385.1\inc\api\hidpi.h 303 driver
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.1\inc\api\hidpi.h 303 driver
Error 6 error C2377: 'NTSTATUS' : redefinition; typedef cannot be overloaded with any other symbol c:\winddk\7600.16385.1\inc\api\hidpi.h 303 driver
OK so I read somewhere that I have to upgrade the Windows SDK too, I had the Microsoft Windows SDK v6.0A, I downloaded and installed the windows SDK v7.0. But then looks like I have two SDK now? How I properly do the SDK upgrade in visual studio?
I very much appreciate your help,
Thanks, Carlos