0

Problem

I want to programmatically throw Windows Joystick move events using c++, but I am unsure how.

Someone had mentioned writing my own custom device driver. I've never done anything like that before.

Can anyone point me in the right direction?

What have I tried?

1) I first looked into VJoy and it's SDK as a way to do this.

I ran the demo code but it required the Vjoy driver installed. I tried to do this but received a "Procedure Entry Point Not Found in Msvcrt.dll File " error causing the installation to fail.

The suggested fix by Microsoft was to...

...use the Windows XP Recovery Console to replace the Msvcrt.dll file with the original version.

(I believe the Msvcrt.dll Version should be 7.0.2600.0 but mine is 7.0.2600.5512.)

This required a Windows XP CD-ROM, which I do not have.

2) I had thought I could maybe achieve the same thing with the DirectX DirectInput component follwoing this tutorial. I also installed the DirectX SDK to get the .lib files and headerfiles I needed.

The tutorial said:

You'll need to include the DirectInput header file in order to use any of the DirectInput functions:

#include <dinput.h>

In order to link a final application binary, you'll need to include the following following libraries in your project:

dinput8.lib dxguid.lib

I linked the librarys correctly but when I included dinput.h and built I received the following errors

1>  Main.cpp
1>  c:\program files\microsoft directx sdk (june 2010)\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(1991): error C2059: syntax error : 'constant'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(1991): error C2238: unexpected token(s) preceding ';'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(1999): error C2059: syntax error : 'constant'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(1999): error C2238: unexpected token(s) preceding ';'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(2220): error C2059: syntax error : 'constant'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(2220): error C2238: unexpected token(s) preceding ';'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(2232): error C2059: syntax error : 'constant'
1>c:\program files\microsoft directx sdk (june 2010)\include\dinput.h(2232): error C2238: unexpected token(s) preceding ';'

Some extra info

I am using Windows XP.

I am a c++ novice.

Kevvvvyp
  • 1,704
  • 2
  • 18
  • 38
  • If I'm unclear at any point or my tags are incorrect etc, let me know so I can try improve the question. Thanks. – Kevvvvyp May 28 '15 at 12:10
  • Could you suggest some improvements with your downvote please? – Kevvvvyp May 28 '15 at 12:14
  • You need to use something like VJoy, DirectInput won't help you. In order to resolve your problem with installing VJoy, try containing the developers as instructed on this page: http://vjoystick.sourceforge.net/site/index.php/download-a-install/80-install-x86x64 – Ross Ridge May 28 '15 at 17:57
  • @RossRidge thanks I'll give that a try, appreciate it – Kevvvvyp May 28 '15 at 18:03

0 Answers0