12-21-2012 06:24 AM
Hello,
We have a software(C#, .NET Framework 2) with the old gpib-32.dll file, which runs on a 32bit system, now we would like to update this software to a 64bit system and also with a new adapter ( GPIB-USB-HS ). This adapter only supports the ni4882.dll file and isn't compatible with the gpib-32.dll. Now the problem is, if I try to add the ni4882.dll to the project in Visual Studio 2010 (Project -> add Reference) I always get the same error: "A reference to %path% could not be added. Please make sure that the file is accessilbe, and that it is a valid assemlby or COM component. ", how can I fix that? or is there any other way to add the 4882.dll file to the project?
Thanks
12-27-2012 04:50 AM
Hello IMT_Buchs,
your problem seems to be an issue with the Visual Studio 2010 software.
I found out that you can add a DLL (or EXE) to a project only if it is a .NET assembly. If it's not you will see this error message.
There is a way which possibly allows you to add the dll. Please try the following steps:
Open cmd (Click Start and type "cmd" in the search bar)
Find TlbImp.exe. Probably located in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin. If you can't find it go to your root folder (C:\ or D:) and run:
dir tlbimp.exe /s //this will locate the file.
Run tlbimp.exe and put your dll behind it. Example: If your dll is ni4882.dll. You can run:
TlbImp.exe ni4882.dll
01-02-2013 12:15 AM
Hallo EduardGross
Thank you very much for your Answer, I've also tried this before but unfortunately it did not work. I always get the error "TLBIMP: error TI0000: The input 'C:\Windows\system32\ni4882.dll' is not a valid type library."
Regards,
IMT_Buchs
01-02-2013 02:16 AM
Hi IMT_Buchs,
sorry to hear this didn't work for you. As I said that this is some problem that has to do with Visual Studio and not our .dll file, which should normally work out just fine.
In this matter I can just try helping you with a solution I have to search in the MS Forums and else.
There again I found some advice which helped some people with this error message in VS2005, maybe it will work out in VS2010 as well:
Step 1) Add the DLL as a resource. To do this open the project, select the resources tab, select "add existing file" and add the DLL as a resource.
Step 2) Add the name of the DLL as a string resource.
Step 3) Add this code to your main form-load: (In this example my project is called "USBXpress_TestPanel", and the DLL file I'm using is "SiUSBXp.dll").
if (System.IO.File.Exists(USBXpress_TestPanel.Properties.Resources.DLLName + ".DLL") == false)
{
System.IO.StreamWriter OutStream;
System.IO.BinaryWriter BinStream;
// Create the DLL file
OutStream = new System.IO.StreamWriter(USBXpress_TestPanel.Properties.Resources.DLLName + ".DLL", false);
BinStream = new System.IO.BinaryWriter(OutStream.BaseStream);
BinStream.Write(USBXpress_TestPanel.Properties.Resources.SiUSBXp);
BinStream.Close();
}
__________________
I did not try this myself and I can't guarantee it works.. but I hope it will do for you.
Regards,
Eduard Gross
National Instruments
01-08-2013 02:16 AM
Hi IMT_Buchs,
did the last post bring you any further or shall i keep looking for a solution?
Regards,
Eduard Gross
National Instruments
01-08-2013 03:16 AM
Hi Eduard Gross
No... but i found a solution for the problem, the ni4882.dll is the old dll of National Instruments, so i downloaded the newest version of the National Instruments Software, which includes the new Nationalinstruments.ni4882.dll. With this DLL the References Import works and i can connect my GPIB-USB-HS with the computer software.
Thank you very much for your help!
regards ,
IMT_Buchs
11-01-2013 08:20 AM - edited 11-01-2013 08:36 AM
I'm having a similar problem with ni_opcua_client.dll.
When I run a web site in VS2008 referencing a interop ddl built in Labview I get the message:
"Missing Dependency in: Read.vi: Library not found or failed to load: ni_opcua_client.dll"
I try to place this dll in every place I could figured out but the message remains. I get the same error in VS2010 Express.
When I run a form it just crash instantly with the message:
The dump files are attached.
TlbImp.exe call result in invalid error.
I'm running LV2012 (without SP) in a WS2008 R2.
Thanks.