Offsite or in-place activation

During execution, when a user activates the object in the OLE control, PowerBuilder tries to activate an embedded object in place, meaning that the user interacts with the object inside the PowerBuilder window. The menus provided by the server application are merged with the PowerBuilder application’s menus. You can control how the menus are merged in the Menu painter (see “Menus for in-place activation”).

When the control is active in place, it has a wide hatched border:

The sample screen shows a wide border of hatch lines.

Offsite activation means that the server application opens and the object becomes an open document in the server’s window. All the server’s menus are available. The control itself is displayed with shading, indicating that the object is open in the server application.

NoteLimits to in-place activation The server’s capabilities determine whether PowerBuilder can activate the object in place. OLE 1.0 objects cannot be activated in place. In addition, the OLE 2.0 standards specify that linked objects are activated offsite, not in place.

From the Window painter, the object is always activated offsite.

Changing the default behavior

You can change the default behavior in a script by calling the Activate function and choosing whether to activate an object in place or offsite. If you set the control’s Activation setting to Manual, you can write a script that calls the Activate function for the DoubleClicked event (or some other event):

ole_1.Activate(Offsite!)

NoteWhen the control will not activate You cannot activate an empty control (a control that does not have an OLE object assigned to it). If you want the user to choose the OLE object, you can write a script that calls the InsertObject function.

If the object in the control is linked and the linked file is missing, the user cannot activate the control. If the Update property is set to Automatic, PowerBuilder displays a dialog box so that the user can find the file.

If the Update property is set to Manual, a script can call the UpdateLinksDialog function to display the dialog box, or call LinkTo to replace the contents with another file.