LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does an ActiveX class disappear?

I have a VI in v. 5.1.1 in which I use Automation Open to open a refnum to an object from another application. Wired into the Automation Open I have an Automation RefNum control. When I right click on the Automation RefNum to Select ActiveX Class, then choose Browse, the object is not listed. So I select Browse again from the Select Object From Type Library window and navigate to the .tlb file which contains the info for the desired object. Now I the object appears and I can select it. From this point, everything works fine and I can access the object with no problem. UNTIL I exit the VI and reenter it (sometimes!) for further editing and find that it doesn't remember the ActiveX class. Then I have to go thro
ugh the whole browse and navigate routine again to find the .tlb file all over again.

When I first installed the third party software which has the .tlb file, I couldn't get the ActiveX feature to work at all until I moved the .tlb file into a folder under LabVIEW. Then I could get LabVIEW to see it as described above, but I still have the disappearing problem. So I'm guessing maybe it has something to do with how the ActiveX class is registered or seen by WIndows 95/NT or how LabVIEW accesses that class info.

Any ideas?
0 Kudos
Message 1 of 3
(2,744 Views)
I am pretty sure that the problem is because it is not registered. The utility you use to register an ActiveX DLL is regsvr32.exe but I am not sure how to register a .tlb file.

-Jim
0 Kudos
Message 2 of 3
(2,744 Views)
For the benefit of anyone else having this problem, I have been able to solve it myself.
Thanks Jim Kring for your suggestion. It is true that regsvr32.exe will not register a .tlb file. However, I came across regtlib.exe which did register the .tlb file when I ran it with the .tlb file path as command line argument. The other way is to use regedit.exe to manually edit the registry. The key is in HKEY_CLASSES_ROOT\TypeLib in the registry. After doing this and rebooting, the ActiveX class no longer disappears from my VI.
0 Kudos
Message 3 of 3
(2,744 Views)