DirectX app crashing

I wrote a video jukebox program in C# last year.  I initially used the AudioVideoPlayback namespace, but it's really buggy, so I used the WMP control instead.  However, we used DX to read ID3 tags in the manager program.  Now, a year later, the client has changed the contact person, and every machine he tries to install on gives him this error :

The type initializer for "Microsoft.DirectX.DirentInput.Manager" threw an exception.

in the constructor for the class that uses DX.  The machines are all XP SP2, which means that DX is installed, although I'm not sure if managed DX gets installed by SP2, the installer won't run as it's there already.

The real worry is, it works fine on my dev machine, and works fine on his machine at home.  I've tried with a couple of dll versions ( I have several installed ). 

My constructor looks like this :

public JukeboxDXJoystickController()

{

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

{

device = new Device(di.InstanceGuid);

}

if (device == null)

{

MessageBox.Show("Unable to find attached joystick");

return;

}

device.SetDataFormat(DeviceDataFormat.Joystick);

device.SetCooperativeLevel(null, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);

device.Properties.AxisModeAbsolute = true;

deviceUpdated = new AutoResetEvent(false);

appShutDown = new ManualResetEvent(false);

device.SetEventNotification(deviceUpdated);

Thread threadLoop = new Thread(new ThreadStart(this.ThreadLoop));

threadLoop.Start();

device.Acquire();

}

I previously used joyGetPos, etc, but they proved to be unreliable in C#.  We can still use them and the program runs fine.  Any suggestions are most appreciated.

 




Answer this question

DirectX app crashing

  • Najeeb

     

    One thing to remember when using managed directX is that you need to make sure that the Assemblies or runtime installed on the client is the same as the one that the application was developed in. For example if I developed and application using the Dec2004 release of Managed DirectX I would need to make sure that the Dec 2004 run time was installed.

    I would first have a look at the program and make sure that the correct Assemblies are installed on the client. If you can not rmember what the correct one is you can use reflector to find out.

    If you are still having problems I would also report this in the windows gameing forums as there will be more traffic of people who work with the DirectX Systems.



  • DirectX app crashing