0

I am attempting to communicate with a Testo 454 logger through C#. I downloaded their Testo Toolbox from http://www.testolimited.com/download-centre which includes some documentation and samples in Visual Basic, C++, and LabView. The usage guide specifies that the toolbox is set up as an OLE Automation Server, and can be integrated with languages supporting ActiveX controls, specifically mentioning Visual Basic .NET and Visual C++ .NET. The examples show accessing the object tcddk in the file tcddka.dll.

So far I have only been able to view the library contents using Object Browser. I have had no luck in referencing the library in C#, Visual Basic, or Visual C++ (using Visual Studio 2013). I get an error saying it is not a valid assembly or COM component. I was unsuccessful with using tlbimp.exe on the file, and I couldn't register it with regsvr32. I figure I need to create a C++/CLI wrapper, but I don't see how to do this when I can't create a reference to it in C++.c

I have loaded the DLL onto One Drive for download. https://onedrive.live.com/redir?resid=4A4B22F7A598B126!117&authkey=!AKroG3-O7lsBdeA&ithint=file%2cdll

I am quickly running out of options for how to communicate with this Testo system, and Testo is unresponsive to my inquiries. I would greatly appreciate any help from the stackoverflow community.

3
  • I did, as I maybe didn't mention well enough, and get no response. I get what you're saying. I'm hoping that I just don't know enough about trying to reference a (probably unmanaged) DLL from C#. I'm sure people have done it, I'm just not finding a whole lot of information I am understanding. It would not surprise me at all if the things I've tried actually do work, I just did them wrong. Aug 20, 2015 at 13:55
  • 1
    It is a bit awkward, the type library name has the same as the DLL name. You have to use Tlbimp.exe with the /out option. I'd recommend Tlbimp tcddka.dll /out:Interop.Testo.dll Aug 20, 2015 at 14:17
  • I tried this again, running Developer Command Prompt for VS2013 as administrator. Entered: Tlbimp "C:\Users\user1\Downloads\tcddka.dll" /out:Interop.Test.dll and it executed without errors this time. I found the file in the system32 folder. I was then able to add a reference to the file in my C# app and create an instance of the tcddk class. That is way beyond where I was before; I can't thank you enough Hans Passant. I always figure when things get this difficult, I must be doing something wrong! Aug 20, 2015 at 15:52

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.