Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

CreateObject function – PB Docs 100 – PowerBuilder Library

CreateObject function – PB Docs 100

CreateObject function



Description

Creates an instance of a PowerBuilder class in a PowerBuilder.Application OLE
server session.

Controls

PowerBuilder.Application (automation server)

Syntax

Argument Description
automationobject When PowerBuilder is the OLE client, the
name of the OLEObject instantiated with the PowerBuilder.Application automation
server. For other clients, use syntax appropriate for calling a
function belonging to an automation object.
classname A string specifying the name of the class
you want to create. The class must be defined in one of the libraries
specified in the PowerBuilder.Application LibraryList property.

Return Values

OLEObject. Returns a reference to the instantiated object,
which is valid for automation. If the object could not be created, CreateObject returns
NULL.

Usage

If the OLE client is Visual Basic, you can test for the keyword nothing to
see if CreateObject succeeded.

If the object’s executable type does not correspond
to the value of the MachineCode property, then CreateObject returns
NULL. All the objects created for one PowerBuilder.Application session
must have the same executable type (either Pcode or compiled machine
code). When you create more than one object in a single PowerBuilder.Application
session, those objects can be passed as function arguments or returned
as results.

You do not need to use the CREATE statement
for the OLEObject variable before calling the CreateObject function.

Examples

This example is a PowerBuilder script that starts the PowerBuilder.Application server
and creates an object that is contained in MYLIBRARY.DLL.
If the object is created successfully, the script calls the function uf_calc,
which returns a Long as a status code and passes
back the result of the calculation in the variable ld_result:

This example is a Visual Basic script that does the same tasks
as the PowerBuilder script above:

See Also

  • ConnectToNewObject

Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x