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

Syntax 2 For creating a component instance on the current server – PB Docs 125 – PowerBuilder Library

Syntax 2 For creating a component instance on the current server – PB Docs 125

Syntax 2 For creating a component instance on the current server

Description

Creates an instance of a component running on the current EAServer or COM+ server.
This function is called from within a component instance running
on EAServer or COM+.

Controls

TransactionServer objects

Syntax

Argument

Description

transactionserver

Reference to the TransactionServer service
instance.

objectvariable

A global, instance, or local variable
whose datatype is the same class as the object being created or
an ancestor of that class.

classname (optional)

A string whose value is the name of the
class datatype to be created.

For EAServer components,
you can optionally prepend a package name followed by a slash to
the class name (for example, “mypackage/mycomponent“).

For COM+ components, you can optionally prepend a
ProgID followed by a period to the class name (for example, “PowerBuilder.HTMLDataWindow“.

Return Values

Long. Returns 0 if it succeeds and one
of the following values if an error occurs:

  • 50 Distributed
    service error

  • 52 Distributed communications error

  • 53 Requested server not active

  • 54 Server not accepting requests

  • 55 Request terminated abnormally

  • 56 Response to request incomplete

  • 57 Not connected

  • 62 Server busy

Usage

The CreateInstance function on the TransactionServer
context object allows you to access other EAServer or
COM+ components running on the current server. The created
instance inherits all the transaction and security attributes of
the current object.

On EAServer, the TransactionServer CreateInstance method
invokes the EAServer name
service to create proxies. Proxies for remote components might be
returned by the name service rather than an instance that is running locally.
To guarantee that a locally installed instance is used, specify
the component name as “local:package/component“,
where package is the package name and component is
the component name. The call fails if the component is not installed
in the same server.

The CreateInstance function on the TransactionServer
context object uses the same user and password information that
applies to the component from which it is called.

Before you can use the transaction context service, you need
to declare a variable of type TransactionServer and call the GetContextService function
to create an instance of the service.

Examples

The following statements show how an EAServer component might instantiate another
component in the same server and call one of its methods:

This example shows the syntax for creating an instance
of a COM component:

See Also


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