OLE controls in a window

You can add OLE objects and ActiveX controls to a window or user object. To do so, you use one of the PowerBuilder OLE controls, which acts as an OLE container. This section explains how you select the control you want by choosing whether it holds an OLE object (also called an insertable object) or an ActiveX control:

ActiveX controls range from simple visual displays (such as a meter or a gauge) to single activities that are customizable (spellchecking words or phrases) to working environments (image acquisition with annotation and editing).

OLE control container features

All OLE control containers support a set of required interfaces. PowerBuilder provides some additional support:

Defining the control

This procedure describes how to create an OLE control and select its contents.

StepsTo place an OLE control in a window or user object:

  1. Open the window or user object that will contain the OLE control.

  2. Select Insert>Control>OLE from the menu bar.

    PowerBuilder displays the Insert Object dialog box. There are three tabs to choose from.

  3. Choose a server application or a specific object for the control (which embeds or links an object in the control), select a custom control, or leave the control empty for now:

    • To create and embed a new object, click the Create New tab. After you have chosen a server application, click OK.

    • To choose an existing object for the control, click the Create From File tab. After you have specified the file, click OK.

    • To insert a custom control (ActiveX control), click the Insert Control tab. After you have chosen an ActiveX control, click OK.

    • To leave the control empty, click Cancel.

      If you click Cancel, the control becomes an OLE control rather than an OLE custom control, and you can choose to link or embed an OLE object in it at any time; you cannot insert an ActiveX control later.

  4. Click where you want the control.

    If you inserted an object, PowerBuilder opens the server application so you can view and edit the object. ActiveX controls cannot be opened.

If you want to insert an object that belongs to an OLE server application that is not in the list, see the server documentation to find out how to install it.

For more information about using the Insert Object dialog box, see the section on inserting OLE objects in DataWindow objects in the PowerBuilder Users Guide.