Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Using COM Objects in ABL : Obtaining access to COM objects
 

Obtaining access to COM objects

To access a COM object, you have to define a component handle for it and set the handle value using the appropriate object instantiation. For example:
DEFINE VARIABLE hCOMobject AS COM-HANDLE.
/* ... Instantiate COM object, setting hCOMobject ... */
/* ... Access COM object properties and methods using hCOMobject ... */
/* ... Access ActiveX control events using OCX event procedures ... */
To instantiate an Automation object, you use the CREATE Automation Object statement. For more information, on instantiating Automation objects, see ActiveXAutomation Support.
To instantiate an ActiveX control, you use the AppBuilder at design time to select and configure the control, and to generate ABL that instantiates the control at runtime. This AppBuilder-generated ABL includes the CREATE Widget statement to create the control-frame widget and the LoadControls() method to associate the control instance with the control-frame COM object. For more information on instantiating ActiveX controls, see ActiveXControl Support.
Access to COM object properties and methods is the same for both Automation objects and ActiveX controls. ABL supports event management for both Automation objects and ActiveX controls. For information on ActiveX Automation object event management, see ActiveXAutomation Support. For information on ActiveX control event management, see ActiveXControl Support.