Anyone out there ever gotten the Agilent ActiveX controls to work for controlling a VSpin, BenchCel, VStack, or any of the others? I’ve got the ActiveX dlls, registered them w/ regsrv32, and tried adding them to projects in Visual Studio. I can see the classes via the object browser.
I’ve tried .NET 6, .Net Framework 3.5. I’m compiling for x86. I’ve tried including the dll in the project folder and exe folder. But every time I try to use a Centrifuge class object, I get a COM exception:
System.Runtime.InteropServices.COMException: ‘Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))’
Any advice?
OK, got it somewhat figured out. Posting here for posterity.
In Visual Studio 2022, looks like you can’t directly import ActiveX controls. So you have to use the VS developer command prompt to call
$ AxImp AgilentCentrifuge.dll
That will generate two other dlls - the wrapped up control in AxCentrifugeLib.dll and interops in CentrifugeLib.dll. I added those as references to my project and used the AxCentrifuge object. One odd thing is that is you have to call this CreateControl() method before using the object. I guess previously the windows forms ActiveX import handedl all of these steps.
AxCentrifuge axCentrifuge = new AxCentrifuge();
axCentrifuge.CreateControl();
Looks like it’s working w/ .NET Framework 4.7.2 and I can open and close the door of my VSpin.
3 Likes