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

Using the extension – PB Docs 2019 – PowerBuilder Library

Using the extension – PB Docs 2019

Using
the extension

Using nonvisual classes

In PowerScript, use the classes in a nonvisual extension just as you
would a custom class user object: Declare an instance of the object, use
the CREATE statement to create the instance, invoke the object’s
functions, and destroy the instance when you have finished with it. You
can inherit from the native classes if you want to add functions or events
to the class.

At runtime, instances of the native class are created as normal
PowerBuilder objects.

In this example, the extension module contains two nonvisual native
classes: fontcallback and fontenumerator. A PowerBuilder custom class user
object, nvo_font, inherits from the fontcallback class. These statements
create instances of both classes:

After an instance of a native class has been created, the
PowerBuilder application can call methods on the object. Each native class
must implement an Invoke method that the PowerBuilder VM calls when the
PowerBuilder application calls one of the native class’s methods. Then,
the Invoke method dispatches the method call based on the method ID or
method name. The method name is used when a native method is called
dynamically.

Using the previous example, this statement invokes the
enumprinterfonts method of the instance of the fontenumerator
class:

Destroying the PBNI object
instance

When the PowerBuilder application no longer needs an instance of a
nonvisual class and a DESTROY statement is issued, by either the user or
the garbage collector, or when the window or visual control that contains
a visual class is closed, the PowerBuilder VM destroys the instance by
calling the native class’s Destroy method.


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