Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## COM objects supported in Progress

> Progress supports two classes of COM objects:

> - ActiveX Automation objects.

> - ActiveX controls.

> ##### ActiveX Automation objects

> ActiveX Automation objects (or just Automation objects) are COM objects that encapsulate all or part of an application in a stand-alone executable (EXE file) or dynamic link library (DLL) file. These Automation objects make the encapsulated functionality available to another application.

> Similar to DDE, your OpenEdge application functions in a client/server relationship to the application that provides an Automation object. As such, Progress functions as an ActiveX Automation Controller and accesses the Automation object in the application that functions as an ActiveX Automation Server.

> For example, your OpenEdge application reads and writes data values in the Automation Server by accessing properties and methods of an available Automation object, such as a spread sheet or word-processing document. Depending on the server application, you might even be able to create new Automation object instances (new spread sheets or documents) in the Automation Server from within your OpenEdge application.

> Figure 8–5 shows a series of IPC exchanges between a Progress 4GL application and the Automation objects of an Automation Server:

> Note: Both Progress graphical and character applications can use ActiveX Automation in Windows.

> Figure 8–5: Progress using ActiveX Automation

> In this example, the OpenEdge application gets Progress Value1 from Object A Property1; sets Object A Property2 from Progress Value2; and gets Progress Value3 from a call to Method1 of Object B, possibly after creating an instance of Object B.

> Compare this functionality with DDE (see Figure 8–4). The effects are very similar. However, the access to properties and methods provided by the component model of ActiveX Automation is much more straightforward, robust, and flexible.

> ##### ActiveX controls

> ActiveX controls (OCXs) are COM objects that rely on COM standards, including ActiveX Automation, to communicate with an application and also to provide a mechanism to generate events. ActiveX controls reside only in DLL files that provide the complete implementation, which often includes a user-interface component. As such, ActiveX controls are directly analogous to 4GL widgets, but often include a variety of capabilities not available with the widgets built into the 4GL. For example, you can find ActiveX controls that function as calendars, pie charts, bar graphs, gauges, meters, and even communications, timing, and parsing controls that have no user-interface components.

> Whether or not an ActiveX control includes a user-interface component, Progress supports a user-interface widget, the `CONTROL-FRAME` widget, to make the control available to your application. The control-frame widget anchors the ActiveX control to your application. This widget physically orients the control in the Progress user interface, but provides no other services for accessing it. A separate but related COM object, the control-frame COM object, provides the real control container support. This special Progress-supported COM object contains and provides direct access to the ActiveX control from the 4GL.

> Note: Unlike with ActiveX Automation, you can use ActiveX controls only in OpenEdge graphical applications.

> Support for VBX controls in earlier versions of Progress requires you to use special methods on a control-container widget to access any VBX control property or method. However for ActiveX controls, Progress allows you to access control properties and methods directly, without reference to the control-frame widgets that anchor them.

> Figure 8–6 shows how Progress supports ActiveX controls in the 4GL.

> Figure 8–6: Progress interface to ActiveX Controls

> The control-frame widget and COM object work together to connect the ActiveX control to your application. As you might suspect, Progress supports different types of handles for widgets and COM objects. Thus, you access control-frame widgets using widget handles and access all COM objects (including ActiveX controls) using component handles. It is these component handles that allow you to gain direct access to the properties and methods of an ActiveX control (or Automation object).

> Similar to VBX control support in earlier versions, Progress allows you to define event procedures to handle events generated directly by ActiveX controls. You can also handle events on the control-frame widget with user-interface triggers. Control-frame widget events (like `TAB` or `LEAVE`) allow you to coordinate user-interface actions between ActiveX controls and Progress widgets.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095