LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use an ActiveX component?

Hello, hello,

I've just been given an ActiveX component (.ocx file) and some samples of Visual Basic to evaluate. Apparently VB is no longer available from MS (or where ?) and I was trying to use it in a new CVI project but what do I do with this ocx ? Adding it to the project doesn't do much. And what's the difference between Tools / Create ActiveX Controller and Server ? If I try the former, it's not in the list provided and selecting the ocx file with the [Browse] button gives me a "The type library is not intended for use on Win32". I'm on Win10 64, and I installed the component from a 64-bit msi...

 

Looking for the usually helpful CVI samples, I see plenty have the ActiveX keyword, but I don't see ocx files in their projects.

As you can tell I've never used ActiveX before and I'm lost.

Thanks.

0 Kudos
Message 1 of 5
(4,067 Views)

Hello gdargaud,

First, you must register your ocx file by using "regsvr32 myFile.ocx" (replace myfile with the full pathname of your ocx) . Then, in the UI editor you could find your ActiveX in the control list. Add it to your UIR and generate the code. During this step, depending on your ActiveX, CVI will launch for you the good tool such as "Create ActiveX controler" or "Create activeX serveur". After that you should have a new "Instrument" added to your project.

 

Best regards.

 

 

0 Kudos
Message 2 of 5
(4,042 Views)

Thanks for the answer. I would have thought that the installer has already done that, but I tried and I get: "The module TrioPC64.ocx was loaded but the call to DllRegisterServer failed with error code 0x80040200". There doesn't seem to be a DLL together with this file (but I don't know where Win10 hides things nowadays).

0 Kudos
Message 3 of 5
(4,036 Views)

Hi gdargaud,

Did you try to run the command line with administrator rights ?

I don't have a Windows 10 to test but this works fine on Windows 7. Just be careful on Seven, sometimes you must launch "regsvr32" from Windows\SysWOW64 directory or from Windows\System32. Maybe that could be similar on Win 10.

0 Kudos
Message 4 of 5
(4,029 Views)

OK, as admin it registered. But I still don't see it in the list of available activeX of the Tools/Create controller. OK, I give up for now and will try again in a while...

0 Kudos
Message 5 of 5
(4,025 Views)