比如这个新建的
using Microsoft.DirectX.DirectInput;
namespace Joystick
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Device dev;
//枚举所有设备,游戏手柄只有1个,只取一个GUID
Guid id = new Guid();
foreach (DeviceInstance di in Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly))
{
id = di.ProductGuid;
}
dev = new Device(id);
JoystickState joy = new JoystickState();
}
}
}
只要加入下面的代码调试启动,就完全没反应, InitializeComponent();的断点都不执行。 难道是VS2015 版本问题?