Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5361

DirectInput with LabWindows/CVI

$
0
0

Hi,

 

I'm trying to use DirectInput to get position data from a USB joystick in LabWindows/CVI. CVI 2013 comes with the headers and libs for direct input in its sdk subfolder, and the DirectX SDK comes with a really simple example.

 

However, already the first step of opening creating a directinput handle fails to compile - this is basically copied verbatim from the directInput documentation or the joystick example provided with the DirectX SDK.

 

#include <ansi_c.h>
#define DIRECTINPUT_VERSION 0x0800
#include "dinput.h"

 

int main (int argc, char *argv[])
{
LPDIRECTINPUT8 di;
HRESULT hr;

hr = hr = DirectInput8Create( GetModuleHandle( NULL ), DIRECTINPUT_VERSION, IID_IDirectInput8, ( VOID** )&di, NULL );

return 0;
}

 

60, 42 error: passing 'const GUID' (aka 'const struct _GUID') to parameter of incompatible type 'const IID *' (aka 'const struct _GUID *')

18, 1 In file included from c:\Users\tpaprotta\Documents\National Instruments\CVI\Command-line Application.c:18:

"dinput.h"(2682,83) c:\program files (x86)\national instruments\cvi2013\sdk\include\dinput.h:2682:83: note: passing argument to parameter 'riidltf' here

 

The same code compiles without issues under Visual Studio 2012.

 


Viewing all articles
Browse latest Browse all 5361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>