Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : ActiveX Control Support : Accessing ActiveX controls at runtime : Accessing the control handle
 
Accessing the control handle
Once the ActiveX control is instantiated, the control-frame affords access to one widget and three COM objects, including the:
*Control-frame widget
*Control container (the control-frame COM object)
*Control collection (a standard COM object)
*ActiveX control (the target COM object)
The following figure shows the chain of handle references that connect a control-frame widget (with widget handle CF) to an ActiveX control (with the Name CSSpin).
Figure 61. Handle references to access ActiveX controls
The chCF reference is a component handle to the control-frame COM object (control container) and the chCOL reference is a component handle to the control collection. Thus in ABL, you can instantiate and get the handle to an ActiveX control in two ways:
*Using the name of the ActiveX control (CSSpin) as if it were a property (Control-Name property) of the control container (chCF:CSSpin)
*Using the indexed Item property of the control collection (chCOL:Item(1))
Once you have the component handle of the ActiveX control, you can access all of its properties and methods. (The chCSSpin reference is a component handle variable you might set from chCF:CSSpin or chCOL:Item(1).) The following examples reference a reduction of typical code generated by the AppBuilder. For a closer look at actual code generated by the AppBuilder, see Programming ActiveX controls in the AppBuilder.
* Using the Control-Name property of the control container
* Using the item property of the control collection
* The handle connections