01-28-2009 03:03 PM
Hello all,
My LabVIEW ver: 8.2
OS: Windows XP
A vendor has given me some instrument drivers in the form of .NET DLLs (several DLLs). I've been able to sucessfully write wrappers (.VIs) around them, and all seem to be working fine.
The issue I'm running into is the following: very randomly, an exception is thrown by the DLLs (I still don't know why that is). The LabVIEW error describes more or less the following: "Cannot find abc.dll at C:\Program Files\etc etc" . If I manually copy the DLL to the expected path all works fine once again. However, the error will show up again after a while, and this time, it wants the abc.dll at some other location. Again, if I manually copy the DLL to the expected path all works ok.
I've looked into "registering" the .NET DLLs up front, but so far have not been able to find a way to do this.
Any ideas as to what is going on?
01-28-2009 05:47 PM
Where are these various paths?
How are they related to your application?
Can you just put the DLL in the Windows System directory?
Mike...
01-28-2009 06:01 PM
Hi Mike,
The various paths are everywhere! one time it may want to see the ABC.DLL in C:\windows\system32, another time in C:\Program Files\Blah Blah, etc
These paths are not related to my application at all. In some cases they are though.
If I manually put the ABC.DLL in the path is complaining about, all seems to work.
This is the error msg I'm getting:
"Error accessing property EieParallelTest.TestManager.Api.Interface.IEnvironment.Controllers of ObjectId handle: 0x5A5115C for obj 0x2B8BB1[EieParallelTest.TestManager.Environment] in domain [LabVIEW Domain for Run] and thread 7464, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Documents and Settings\user123\ABC.dll' or one of its dependencies. The system cannot find the file specified.
) in PROOF OF CONCEPT2.vi
01-28-2009 06:26 PM
Hmmmm... Very strange...
What is the .Net component you are trying to call? Can you post an example of the code?
Mike...
01-28-2009 06:42 PM
I've also started the same thread on LAVA: http://forums.lavag.org/Issues-calling-NET-DLLs-from-LabVIEW-t13005.html
There is a snippet of code there.