none
Getting at DirectInput from within a WPF application... RRS feed

  • Question

  •  

    Ok, simple question: How do I best get the Xbox 360 Games for Windows controller to work in WPF ??

     

    I guess that could be rephrased to how do I get access to Microsoft.DirectX.DirectInput.Manager.GetDevices

     

    When I try something like:

     

    using System;

    using System.Collections.Generic;

    using System.Text;

    using System.Windows;

    using System.Windows.Controls;

    using System.Windows.Data;

    using System.Windows.Documents;

    using System.Windows.Input;

    using System.Windows.Media;

    using System.Windows.Media.Imaging;

    using System.Windows.Shapes;

    using Microsoft.DirectX;

    using Microsoft.DirectX.DirectInput;

    using System.Diagnostics;

     

    public partial class Window1 : System.Windows.Window

    {

    public Window1()

    {

    InitializeComponent();

     

    foreach (DeviceInstance instance in Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly))

    {

    Debug.Print(instance.ToString());

    }

    }

    }

     

    It says its not a valid Wind32 application...

     

    Ideas ?

     

    a4w

    Tuesday, September 25, 2007 7:55 PM

Answers

  • If you change the active configuration from "Any CPU" to "x86", it should build an app that can link with managed DirectX.

    Wednesday, September 26, 2007 6:36 AM

All replies

  • If you change the active configuration from "Any CPU" to "x86", it should build an app that can link with managed DirectX.

    Wednesday, September 26, 2007 6:36 AM
  • That solved it.. Thanks !!

    Thursday, September 27, 2007 10:13 PM
  •  

    I xbox Controller is generally controlled by the XInput Classes and not DirectInput, also if you are just starting out using Managed DirectX I would start to look at XNA or creating your own wrapper for the Native classes as the Managed DirectX System has been Stopped and no furthur development will be done on it.
    Thursday, September 27, 2007 10:55 PM
    Moderator
  • Hi, if I want to use my joystick within a WPF application, how can I do that?

    br
    Kien
    Thursday, October 25, 2007 5:59 AM
  • You'll probably get more feedback if you open this as a new question rather than as a post to a question that has already been marked as answered.

     

    Thursday, October 25, 2007 6:44 AM