Creating a PowerBuilder extension
To build a PowerBuilder extension, follow these steps:
Step 1: Decide on a feature to implement.
Step 2: Define the classes and functions in the extension .
Step 3: Declare native classes and global functions.
Step 4: Implement native classes and global functions.
Step 5: Export methods to create class instances.
These steps apply whether you are building a nonvisual or a visual extension. The differences between building nonvisual and visual extensions are described in "Creating and using a visual extension". This section focuses primarily on nonvisual extensions.
Required methods
All PowerBuilder nonvisual extensions must export two methods: PBX_GetDescription and PBX_CreateNonVisualObject. The use of these methods is described in "Step 2: Define the classes and functions in the extension " and "Step 5: Export methods to create class instances".
PowerBuilder visual extensions must export PBX_GetDescription and PBX_CreateVisualObject. See "Creating and using a visual extension".
If the extension declares global functions, it must also export the PBX_InvokeGlobalFunction method.
For every native class, you must implement two PBNI methods, Invoke and Destroy, in addition to the methods the class will provide. The use of these PBNI methods is described in "Step 4: Implement native classes and global functions".