Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
7 ratings:
 3.14 out of 5   

ActiveX Creatable Objects

Primary Software: LabVIEW Development Systems
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: When selecting an ActiveX Class for my Automation Refnum in LabVIEW, there is a checkmark in the Select Object from Type Library dialog box that says "Show Creatable Objects Only". What is a creatable object?

Solution: There are two ways of creating a reference to an ActiveX object: externally-creatable object, and a dependent object.

You can create a reference to an externally creatable object directly, but you will need to create a reference to a dependent object indirectly through the method of a higher-level object in the component's object hierarchy.

To create a reference in LabVIEW, an Automation Refnum for that object is first placed on the front panel to act as a template. That control refnum is wired to the Automation Open VI and a valid ActiveX refnum for that object is returned. If an object is not creatable, then it is dependent. Valid references must be obtained using Invoke Nodes to call methods for higher-level objects.

We can use LabVIEW's own ActiveX type library to illustrate. Here, the Labview.Application object is the creatable object. This can be instantiated with "Open Automation". Once a valid refnum for the application class has been obtained, it can be wired to an Invoke Node. We can then use the "GetVIReference" method to create a reference to a specific VI. We could not open a VI reference directly because it is not a creatable object. (See the attached example VI.)

Related Links:



Report Date: 08/29/2000
Last Updated: 05/06/2005
Document ID: 20SF2JDM

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit