PowerBuilder Native Interface Programmers Guide and Reference

Appeon PowerBuilder® 2019 R3

FOR WINDOWS

DOCUMENT ID: DC37794-01-1900-01

LAST REVISED: January 13, 2021

Copyright © Appeon. All rights reserved.

This publication pertains to Appeon software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement.

Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Appeon Inc.

Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Inc.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP and SAP affiliate company.

Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other countries.

Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.

All other company and product names mentioned may be trademarks of the respective companies with which they are associated.

Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.

Appeon Inc., 1/F, Shell Industrial Building, 12 Lee Chung Street, Chai Wan District, Hong Kong

Table of Contents

Programmers Guide
Introduction to PBNI
About PBNI
The elements of PBNI
The PBNI SDK
Comparing PBNI and JNI
Building PowerBuilder Extensions
Nonvisual extension example
Creating a PowerBuilder extension
Adding an extension to a PowerBuilder target
Using the extension
Creating and using a visual extension
Creating visual class instances
Event processing in visual extensions
Calling PowerScript from an extension
Exception handling and debugging
Creating Marshaler Extensions
About marshaler extensions
Developing the PowerBuilder extension
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
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++
Accessing result sets
Processing PowerBuilder messages in C++
More PBNI possibilities
Reference
PBNI Types and Return Values
PowerBuilder to PBNI datatype mappings
Types for access to PowerBuilder data
PBNI enumerated types
Error return values
PBNI Interfaces, Structures, and Methods
Header file contents
Class and interface summary
IPB_Arguments interface
IPB_ResultSetAccessor interface
IPB_RSItemData interface
IPB_Session interface
IPB_Value interface
IPB_VM interface
IPBX_Marshaler interface
IPBX_NonVisualObject interface
IPBX_UserObject interface
IPBX_VisualObject interface
PBArrayInfo structure
PBCallInfo structure
PB_DateData structure
PB_DateTimeData structure
PB_TimeData structure
PBX_DrawItemStruct structure
PBArrayAccessor template class
PBBoundedArrayCreator template class
PBBoundedObjectArrayCreator class
PBObjectArrayAccessor class
PBUnboundedArrayCreator template class
PBUnboundedObjectArrayCreator class
Exported methods
Method exported by PowerBuilder VM
PBNI Tool Reference
pbsig190
pbx2pbd190
Appendix
APPENDIX A Using the Visual Studio Wizards
Where the wizards are installed