Context information – PB Docs 2021

Context information

The PowerBuilder context feature allows applications to access
certain host (non-PowerBuilder) services. This is a PowerBuilder
implementation of functionality similar to the COM QueryInterface.
PowerBuilder provides access to the following host services:

PowerBuilder creates service objects appropriate for the current
execution context (native PowerBuilder or transaction server). This allows
your application to take full advantage of the execution
environment.

The context feature uses seven PowerBuilder service objects:
ContextInformation, ContextKeyword, CORBACurrent, ErrorLogging, Inet,
SSLServiceProvider, and TransactionServer; it also uses the InternetResult
object. (The context feature is sometimes called the Context object, but
it is not a PowerBuilder system object.)

For more information about these objects, see Objects and Controls or the section called “Browsing the class hierarchy” in Users Guide.

Enabling a service

Before you use a service, you instantiate it by calling the
GetContextService function. When you call this function, PowerBuilder
returns a reference to the instantiated service. Use this reference in dot
notation when calling the service’s functions.

To enable a service:

  1. Establish an instance variable of the appropriate type:

  2. Instantiate the instance variable by calling the
    GetContextService function:

Using a CREATE statement

You can instantiate a service object with a PowerScript
CREATE statement. However, this always creates an object for the default
context (native PowerBuilder execution environment), regardless of where
the application is running.


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