Syntax 1: for TransactionServer objects
Description
Creates an instance of a component running on the COM+ server.
This function is called from within a component instance running on
COM+.
Applies to
TransactionServer objects
Syntax
|
1 |
transactionserver.CreateInstance (objectvariable {, classname } ) |
|
Argument |
Description |
|---|---|
|
transactionserver |
Reference to the TransactionServer service |
|
objectvariable |
A global, instance, or local variable whose datatype is |
|
classname (optional) |
A string whose value is the name of the class datatype For COM+ components, you can optionally prepend a ProgID |
Return value
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 COM+ components running on the current
server. The created instance inherits all the transaction and security
attributes of the current object.
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
This example shows the syntax for creating an instance of a COM
component:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Integer rc OleObject lole TransactionServer lts lole = create OleObjectrc = this.GetContextService("TransactionServer", lts) IF rc <> 1 THEN return "Error from GetContextService " + String (rc) END IF // PBCOM is the ProgID, n_genapp is the class namerc = lts.CreateInstance(lole, "PBCOM.n_genapp") IF rc <> 0 THEN return "Error from CreateInstance " + String (rc) END IFiole.my_func () |
See also