だから私は、わずか数行の簡単なアプリケーションを持っている:C#のDirectX入力問題
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.DirectInput;
namespace asdasd
{
public partial class Form1 : Form
{
public Device joystick;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
foreach (
DeviceInstance di in
Manager.GetDevices(
DeviceClass.GameControl,
EnumDevicesFlags.AttachedOnly))
{
joystick = new Device(di.InstanceGuid);
break;
}
if (joystick == null)
{
throw new Exception("No joystick found.");
}
}
}
}
をし、私は自分のコンピュータ上のアクティブなジョイスティックを取得しようと、私はエラーを取得:
私はMicrosoft.DirectX.DirectInputアセンブリを持っており、私はdirectX SDK 2010をインストールしています。
誰かが問題がどこにあるか教えていただけますか?
ありがとうございます! :) – TreantBG
あなたは大歓迎です:) –