a very basic question

Post Reply
siddharth
Posts: 6
Joined: Tue Jun 02, 2009 5:10 pm

a very basic question

Post by siddharth »

Hi,
This is probably a really basic question, but I am putting in the forum anyways. I downloaded Rigidbody sample application that uses NPRRigidBody.dll. I am using Visual Studio 2005 and was just trying to run this sample code. Upon running the code, it throws exception "Unable to load DLL 'C:\Program Files\NaturalPoint\RigidBody\API\NPRigidBody.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)".

Things that I tried to do are:
1) try to add the dll as a reference which I could not. It said that please make sure that the file is accessible and a valid COM component.
2) So, I tried to create an interop dll from the original NPRigidBody.dll but that gave me an error too.
3) I tried to register the dll using regsvr32 command but that failed too.
4) In .NET reflector, trying to load NPRigidBody.dll says that CLI header is missing if that helps anyone to point me in the right direction.

Your help is much appreciated. I might be missing some basic point here, but all I am trying to do is to use NPRigidBody.dll. And the easiest way to see that seems to just run rigid body sample application provided on the web site.

Thanks.
VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: a very basic question

Post by VincentG »

What version of Windows are you using?

What version of the OptiTrack software do you have installed?
siddharth
Posts: 6
Joined: Tue Jun 02, 2009 5:10 pm

Re: a very basic question

Post by siddharth »

I have Windows XP Professional (2002) with service pack 3 installed. My optitrack.dll 's version is 1.1.35.0. Thanks for the reply.
pdoran
Posts: 1
Joined: Wed Jun 24, 2009 9:56 am

Re: a very basic question

Post by pdoran »

Has there been a solution to this? I have the same problem, except I'm using Vista SP1 and version 1.4 of OptiTrack.

Thanks
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: a very basic question

Post by beckdo »

My advice is to migrate the the latest posted Tracking Tools. It has a nearly identical interface to the API plus lot of additional methods. This will hopefully solve your issue.
TobiasFontys
Posts: 2
Joined: Mon Mar 01, 2010 7:47 am

Re: a very basic question

Post by TobiasFontys »

I jut installed the latest versions of the tracking tools and the OptiTrack SDK and i have the same problem. The C# Rigid Body sample cannot open the dll and i cannot load the dll as a reference in a C# project. Does anyone have an idea how i can sovle this?
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: a very basic question

Post by beckdo »

When using the Tracking Tools API (NPTrackingTools.DLL) from .Net, you'll want to use [DLLImport] to pull in all the function definitions from the NPTrackingTools.h native C header file. OptiTrack SDK is completely separate from the Tracking Tools and the Tracking Tools API and does not need to be installed.
TobiasFontys
Posts: 2
Joined: Mon Mar 01, 2010 7:47 am

Re: a very basic question

Post by TobiasFontys »

I am not trying to load the trackingtools dll but the NPRigidBody.dll. the code is all the original code from the sample project from optitrack, and it seems ok to me.

const string DllLoc = "C:\\Program Files\\NaturalPoint\\RigidBody\\API\\NPRigidBody.dll";

[DllImport(RigidBody.DllLoc, EntryPoint = "RB_InitializeRigidBody")]
public static extern int Initialize();

I dont know if the dll is written in C++ or C# but the InteropServices package is included so that shouldnt be a problem.

I dont understand what i am supposed to do with the NPRigidBody.h file.

I also tried to add the dll as a reference on a clean project and that gave the same error.
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: a very basic question

Post by beckdo »

Ok, the NPRigidBody.dll is nearly identical to the NPTrackingTools.dll, they are both flat native C interfaces. Both DLLs do not contain any C# or have any requirements for the CLR.

If you're trying to access either of these from .NET you don't need to include the .H file into your project, but instead you should use it as a reference to create your [DllImport]s.

One question though, if you're using NPRigidBody.DLL that would suggest you are licensed to run the Tracking Tools and alternatively use NPTrackingTools.DLL, which is something you should consider.
Post Reply