Error TDx.TDxinput.dll

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
devdev
Posts: 4
Joined: Mon Oct 15, 2012 7:27 am

Error TDx.TDxinput.dll

Post by devdev »

Hi there,
I wanted to Implement a Spacemoude into my C# Programm using TDx.TDxinput.dll that works fine in the beginning, but after 2 or 3 times in my EventHandler it stops working, and if I try to add or remove Eventhandlers always get this Exeption
System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.
at System.Runtime.InteropServices.ComTypes.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
at TDx.TDxInput._ISensorEvents_EventProvider.add_SensorInput(_ISensorEvents_SensorInputEventHandler )
at TDx.TDxInput.SensorClass.add_SensorInput(_ISensorEvents_SensorInputEventHandler )

A first chance exception of type 'System.Runtime.InteropServices.InvalidComObjectException' occurred in MyProgram.exe
An unhandled exception of type 'System.Runtime.InteropServices.InvalidComObjectException' occurred in MyProgram.exe

Additional information: COM object that has been separated from its underlying RCW cannot be used.
I Use Win Xp and Visual Studio 2005 I tried it with the SpacePilot Pro and the Spacenavigator, with the current Treiber and the new Beta. And TDx.TDxinput.dll is running in version 1.1.0.0
Im not sure if it is the best way, it is my first time i want to integrate a Space mouse. Would be great if you can help to solve my problem or some tips how to Implement the Spacemouse into C# and .net Program wih some C++/cli code.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Error TDx.TDxinput.dll

Post by jwick »

You might want to look at the other C# samples. There is a WPF sample that uses Raw Input to access the device.

For TDxInput, we usually find that programmers loose track of the object lifetime and the object gets deleted on them by the garbage collector. You might want to examine the scope of the objects you are creating.

If you are using C/C++, it is far easier to use the 3DxWare SDK.
devdev
Posts: 4
Joined: Mon Oct 15, 2012 7:27 am

Re: Error TDx.TDxinput.dll

Post by devdev »

Hallo, thanks for the quick reply!!
Now I actually managed to run TDx.TDxinput.dll. But now i have the next Problem with the key down and up Event. In only catch events on the right button of my Spacenavigator or only FIT Events of my Spacepilot Pro. And i would like to know how can I receive Events of the other keys as well (the left key of the Spacenavigator, or at least some other keys of my Spacepilot)
Thanks for your help!

Cheers devdev
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Error TDx.TDxinput.dll

Post by jwick »

devdev wrote:Hallo, thanks for the quick reply!!
Now I actually managed to run TDx.TDxinput.dll. But now i have the next Problem with the key down and up Event. In only catch events on the right button of my Spacenavigator or only FIT Events of my Spacepilot Pro. And i would like to know how can I receive Events of the other keys as well (the left key of the Spacenavigator, or at least some other keys of my Spacepilot)
Thanks for your help!

Cheers devdev
The driver is probably using a profile for your application that maps those buttons to some internal function. If you are using the shipping driver, open the 3DxWare GUI, and map each buttons to a function that will send it to your application -- Button 1, Button 2, Button 3, etc. Or if using 3DxWare 10, create a profile for your application using the 3D Mouse template.
Post Reply