I have some experience working in visual C#. lately i wanted to identify keyboard and joystick inputs, therefore I chose to implement a source code with windows raw input API. Since visual studio does not contain the struct RAWINPUTDEVICE i chose to go with visual C++. when I tried the sample code provided in MSDN following type of errors pop up in servprov.h file. below is the source code I used.
#include "stdafx.h"
#include "rawInputTestCPP.h"
#include <Windows.h>
void main(){
RAWINPUTDEVICE Rid[4];
Rid[0].usUsagePage = 0x01;
Rid[0].usUsage = 0x05;
Rid[0].dwFlags = 0; Rid[0].hwndTarget = 0;
Rid[1].usUsagePage = 0x01;
Rid[1].usUsage = 0x04;
Rid[1].dwFlags = 0; Rid[1].hwndTarget = 0;
Rid[2].usUsagePage = 0x0B;
Rid[2].usUsage = 0x00;
Rid[2].dwFlags = RIDEV_PAGEONLY; Rid[2].hwndTarget = 0;
Rid[3].usUsagePage = 0x0B;
Rid[3].usUsage = 0x02;
Rid[3].dwFlags = RIDEV_EXCLUDE; Rid[3].hwndTarget = 0;
if (RegisterRawInputDevices(Rid, 4, sizeof(Rid[0])) == FALSE) {
}
}
errors popped up are as follows
Error 1 error C2872: 'IServiceProvider' : ambiguous symbol c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h 96 1
Error 2 error C3699: '*' : cannot use this indirection on type 'IServiceProvider' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h 96 1
Error 3 error C2371: 'IServiceProvider' : redefinition; different basic types c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h 103 1
Error 4 error C2872: 'IServiceProvider' : ambiguous symbol c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h 120 1
Error 5 error C2872: 'IServiceProvider' : ambiguous symbol c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h 241 1
Error 6 error C2872: 'IServiceProvider' : ambiguous symbol c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h 251 1
Error 7 error C2872: 'IServiceProvider' : ambiguous symbol C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\urlmon.h 6459 1
Error 8 error C2872: 'IServiceProvider' : ambiguous symbol C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\urlmon.h 6461 1
any idea why these errors pop up?