Page 1 of 2

C# - OptiTrack.dll ?

Posted: Mon Oct 10, 2011 6:30 pm
by johnbsys
HELP!! I am trying to access my TrackIR 5 in a C# WPF program. I'm a newbee and just downloaded the Camera SDK Version 1.1.1. I could find no OptiTrack.dll that is referenced many times throughout the forums. I found one at Kinearx2DOTNodeSetup but I cannot get a simple class create statement to work.

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
OptiTrack.NPCameraCollectionClass cc = new OptiTrack.NPCameraCollectionClass();
}
}

I get the error:

"Retrieving the COM class factory for component with CLSID {1CA83C6F-70A6-40EB-836F-D9EEC0BD168F} failed due to the following error: 80040154."

Any guidance would be GREATLY appreciated.

Thanks!

Re: C# - OptiTrack.dll ?

Posted: Wed Oct 12, 2011 3:17 pm
by NaturalPoint - Mike
Hello -

First things first, the TrackIR is not intended for use with the SDK. It is a gaming peripheral, and while it is compatible with the SDK, technical support for this application is not guaranteed. The Camera SDK is intended for use with the OptiTrack line.

Having said that, Check out sysinternals for process explorer and listdlls. They may be able to help you trace the issue and find the missing components.

Re: C# - OptiTrack.dll ?

Posted: Wed Oct 12, 2011 4:57 pm
by johnbsys
Mike thanks for your reply. It looks like my System32/MSCOREE.DLL is missing GPSVC.DLL and IESHIMS.DLL. I am running Vista 64 Professional. Will dig further unless you have any suggestions?

Re: C# - OptiTrack.dll ?

Posted: Wed Oct 12, 2011 5:09 pm
by NaturalPoint - Mike
Based on this error, the first thing I would do is re-install your MS Visual Basic Runtimes (both x86 and x64) for 2005, 2008 and 2010.

Edit: Also check your .net framework and ensure you have the proper versions installed, and they are up to date.

Re: C# - OptiTrack.dll ?

Posted: Wed Oct 12, 2011 6:52 pm
by johnbsys
I'm writing apps with .NET 4.0 and VS 2010 C# and MS Expression Blend with no problems. Everything is current. I did some research and it was able to copy an IESHIMS.dll to Windows/sysWOW64. that took care of half the problem. I copied a different versions of GPSVC.DLL into Windows/SysWOW64 and now Dependencey Walker gets an error saying that the gpsvc.dll in SYSTEM32 is 64 bit. When I delete the one in sysWOW64 it reverts back to gpsvc.dll not found. :-(
Still searching....

Re: C# - OptiTrack.dll ?

Posted: Wed Oct 12, 2011 7:22 pm
by johnbsys
I found MILLIONS of references to this issue on Google, but no solutions. GPSVC.dll show up as 64-bit thus throwing an error.
Still searching....

Re: C# - OptiTrack.dll ?

Posted: Thu Oct 13, 2011 3:52 pm
by LinusA

Re: C# - OptiTrack.dll ?

Posted: Fri Oct 14, 2011 9:34 am
by NaturalPoint - Mike
Do you have both a 32 bit version and a 64 bit one? The 32 bit should be in syswow and the 64 bit version should be in system32.

Re: C# - OptiTrack.dll ?

Posted: Sun Oct 16, 2011 2:42 pm
by johnbsys
Linus, Thanks for the response. I did see that link and I am building it in x86 mode but I still get the same error.

Mike, That is what I though also but everything I have read shows that GPSVC.dll is dynamically loaded so that it works for both 32 or 64 bit apps.

I am wondering if the OptiTrack.dll from Kinearx2DOTNodeSetup is not the most recent version??

Still searching.....

Re: C# - OptiTrack.dll ?

Posted: Mon Oct 17, 2011 9:44 am
by johnbsys
I started from scratch. Checked out and installed Kinearx2DOTNodeSetup_v1_0.msi

Checked out and built Source code:

svn checkout http://kinearx2dotserver.googlecode.com/svn/trunk/ kinearx2dotserver-read-only

During formLoad it makes it down to the statement:

Program.CameraCollection = new OptiTrack.NPCameraCollectionClass();

Then never comes back to finish the procedure. No errors, nothing in the application error log. It just does not come back from that statement. I placed breakpoints on this statement and the one after it and it does not hit the second breakpoint.

Any thoughts?

Thanks.



private void formLoad(object sender, EventArgs e)
{
TreeNode tn = new TreeNode("Cameras");
Program.CamerasNode = tn;
this.explorer.Nodes.Add(tn);
Program.CameraCollection = new OptiTrack.NPCameraCollectionClass();
Program.CameraCollection.DeviceArrival += new _INPCameraCollectionEvents_DeviceArrivalEventHandler(CameraCollection_DeviceArrival);
Program.CameraCollection.DeviceRemoval += new _INPCameraCollectionEvents_DeviceRemovalEventHandler(CameraCollection_DeviceRemoval);
Program.CameraCollection.Enum();
}