Unable to load dll problem

Post Reply
stanedav
Posts: 6
Joined: Wed Oct 26, 2011 2:49 am

Unable to load dll problem

Post by stanedav »

Hello, I have got project in C# and I am using V120:Trio camera. When in connect the camera to usb it connects successfully, but if I start my project it shows this error:

http://i.imgur.com/Ddh48B2.png
http://i.imgur.com/XeBwYjk.png

I am using DllImport with NPTrackingTools.dll, which is copied into each folder of project. Dll import looks like this:
[DllImport("NPTrackingTools.dll", EntryPoint = "TT_Initialize", CallingConvention = CallingConvention.Cdecl)] public static extern void TT_Initialize();

Where is my problem? When I am using Tracking tools everything goes properly but if I try to connect it with my program it goes wrong.
System is Windows 7.
taylor_np
NaturalPoint Employee
NaturalPoint Employee
Posts: 1
Joined: Thu Feb 07, 2013 9:20 am

Re: Unable to load dll problem

Post by taylor_np »

We recommend using C++/CLI to create .NET wrappers for the Tracking Tools API. It provides better control over how functions and their arguments get mapped into .NET and provides a nicer syntax for you to work with.

Your call to DllImport looks fine, although you might try just removing the EntryPoint and CallingConvention options for starters as they should not be required. I also noticed that the call stack looked like it was erroring at TT_Shutdown. Have you also mapped that function?

It would be helpful if you could paste the text of what follows "Unable to load DLL TrackingTools.dll", either translated to English, or as native text so that we can translate it to English. It may provide more insight on what is happening.
Post Reply