OLEObject object
The OLEObject object acts as a proxy for a remote OLE
object.
You can customize your own version of the OLEObject object
by defining a standard class user object inherited from the built-in
OLEObject. You can then access the OLEObject Constructor, Destructor,
Error, and ExternalException events by writing scripts that contain
code for the events.
Coding Error and ExternalException events
If you code the Error and ExternalException events, any active
exception handler for a RuntimeError will not be processed. However,
you can throw an exception in the scripts for these events, and
you can make the arguments of these events available for exception
handling by putting the arguments in a string in a throw statement
that passes the string to the exception handler.
OLEObject objects are displayed in the OLE tab of the Browser
as Programmable Objects.
For more information about creating a custom
OLEObject object, see the chapter on user objects in the PowerBuilder
Users Guide.
For more information about using the OLEObject
object in an application, see Application Techniques.
OLEObject is a dynamic object
In order to support OLE, OLEObject is a dynamic object. The
PowerBuilder compiler acceps property names and function names and
parameter lists that are not already defined for the object. If
the properties or functions do not exist during execution, you get
a runtime error.
Properties
|
OLEObject property |
Datatype |
Description |
|---|---|---|
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing |
|
Handle |
Objhandle |
Internal use only. |
Events
|
OLEObject event |
Occurs |
|---|---|
|
When the user object is created. |
|
|
When the user object is destroyed. |
|
|
When an error is found in a data or property |
|
|
When the evaluation of an expression |
Functions
|
OLEObject function |
Datatype returned |
Description |
|---|---|---|
|
String |
Returns the name assigned to the user |
|
|
Integer |
Creates a new instance of the class and |
|
|
Integer |
Creates a new OLE object in the specified |
|
|
Integer |
Opens a specified file and connects to |
|
|
Integer |
Associates an OLE object with a PowerBuilder OLEObject |
|
|
Integer |
Releases all objects previously connected |
|
|
Integer |
Returns a pointer to the underlying OLE |
|
|
Integer |
Creates a reference to a context-specific |
|
|
PowerObject |
Returns a reference to the name of the |
|
|
Boolean |
Determines whether a server object is |
|
|
Boolean |
Adds an event to the end of the message |
|
|
Integer |
Releases the pointer to the underlying |
|
|
Integer |
Sets the language locale to be used for |
|
|
Integer |
Sets the automation pointer of an OLEObject |
|
|
Integer |
Sets the number of milliseconds that |
|
|
Integer |
Sends an event to the user object and |
|
|
Object |
Returns the type of the user object |