DisconnectObject
PowerScript function
Description
Releases any object that is connected to the specified OLEObject
variable.
Applies to
OLEObject objects
Syntax
|
1 |
oleobject.DisconnectObject ( ) |
|
Argument |
Description |
|---|---|
|
oleobject |
The name of an OLEObject variable that you want to |
Return value
Integer.
Returns 0 if it succeeds and one of the following negative values if
an error occurs:
-1 — Invalid call: the argument is the Object property of a
control
-9 — Other error
If oleobject is null, DisconnectObject returns null.
Usage
The OLEObject variable is used for OLE automation, in which the
PowerBuilder application asks the server application to manipulate the OLE
object programmatically.
For more information about OLE automation, see
ConnectToObject.
Examples
This example creates an OLEObject variable and connects it to a new
Excel object; then after some unspecified code, it disconnects:
|
1 2 3 4 5 6 7 8 |
integer result OLEObject myoleobject myoleobject = CREATE OLEObject result = myoleobject.ConnectToNewObject( & "excel.application") . . . result = myoleobject.DisconnectObject() |
See also