Programmers Guide

This part provides an introduction to the PowerBuilder Native Interface and a guide to creating PowerBuilder extensions and interacting with PowerBuilder.

Table of Contents

Introduction to PBNI
About PBNI
Understanding PowerBuilder extensions
Embedding the PBVM in a C++ application
The elements of PBNI
The PBNI SDK
Comparing PBNI and JNI
Building PowerBuilder Extensions
Nonvisual extension example
Building the pbadd PowerBuilder extension
Using the extension in PowerBuilder
Creating a PowerBuilder extension
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
Step 6: Build a PBX
Adding an extension to a PowerBuilder target
Using the extension
Creating and using a visual extension
Step 1: Decide on a feature to implement
Step 2: Define the classes and functions in the extension
Step 3: Declare visual classes and global functions
Step 4: Implement native classes
Step 5: Export methods to create class instances
Step 6: Build and use a PBX
Step 7: Use the visual extension in an application
Creating visual class instances
Event processing in visual extensions
Using an event name with return type and arguments
Using an event name with a PowerBuilder event ID
Processing events sent to the parent of the window
Calling PowerScript from an extension
Example: Calling PowerBuilder functions
Exception handling and debugging
Creating Marshaler Extensions
About marshaler extensions
Developing the PowerBuilder extension
Step 1: Describe the extension
Step 2: Implement the creator class
Step 3: Implement the marshaler class
Generating proxies for Java classes
Calling the Java class from PowerBuilder
Exchanging Data with PowerBuilder
About exchanging data with PowerBuilder
Passing values between extensions and the PBVM
PBCallInfo structure
IPB_Arguments interface
IPB_Value interface
Using the IPB_Session interface
Saving data from IPB_Value to a local variable
Using variables throughout a session
Handling enumerated types
Calling PowerBuilder from C++
About calling PowerScript from C++ applications
Calling PowerBuilder objects from C++
Creating a PowerBuilder object to be called from C++
Getting the signature of a function
Creating the C++ application
Running the C++ application
Accessing result sets
Processing PowerBuilder messages in C++
Examples
More PBNI possibilities