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

Creating visual class instances – PB Docs 2022 – PowerBuilder Library

Creating visual class instances – PB Docs 2022

Creating
visual class instances

When the window or other visual control in which a visual native
class resides is created in a PowerBuilder application, the PBVM calls the
PBX_CreateVisualObject method in the extension automatically — the
PowerBuilder application developer does not need to write a
CREATE statement in a script. The PBVM also calls the IPBX_VisualObject’s
CreateControl method. Every extension that contains visual native classes
must export PBX_CreateVisualObject and implement CreateControl.

The following is sample code for PBX_CreateVisualObject:

Registering the window class

Before CreateControl can be called, the window class must be
registered. This code uses the Windows RegisterClass method to register
the window class with the class name s_className:

You must also implement the Windows UnregisterClass method to
unregister the class when the window is closed:

The RegisterClass and UnregisterClass methods are called in the
initialization code for the PBX. This is the Visual C++ DllMain
method:

Implementing CreateControl

Every visual native class must implement the IPBX_VisualObject
CreateControl method. After getting the class name with the
IPBX_VisualObject GetClassName method, CreateControl passes the class name
to the Windows CreateWindowEx method to create the window, then returns
the window handle to the PBVM:


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