IPB_Arguments interface – PB Docs 2017
IPB_Arguments interface The IPB_Arguments interface has two methods: GetCount obtains the number of arguments in a method call. GetAt obtains the value at a specific index of the pArgs member of the PBCallInfo structure. For each argument, GetAt returns a pointer to the IPB_Value interface. The following code fragment uses GetCount and GetAt in a FOR loop to process different argument…
Step 5: Export methods to create class instances – PB Docs 2017
Step 5: Export methods to create class instances PowerBuilder creates nonvisual and visual class instances differently: For visual classes, the instance is created when the window or visual control in which the class is used is opened. See Creating visual class instances. For nonvisual classes, the instance is created when the PowerBuilder CREATEÂ statement is used….
GetAt – PB Docs 2017
GetAt Description Returns a pointer to the IPB_Value interface representing an argument whose order in the list of arguments is indicated by a specified index. Syntax
|
1 |
GetAt ( pbint index ) |
Argument Description index A valid index into the PBCallInfo structure Return value IPB_Value* Examples In the following code fragment, GetAt obtains the first value in the PBCallInfo structure. The…
Step 2: Define the classes and functions in the extension – PB Docs 2017
Step 2: Define the classes and functions in the extension Your C++ code must expose two standard methods that enable PowerBuilder to recognize each native class and create instances of the class. One of these methods is PBX_GetDescription. Use PBX_GetDescription to pass the descriptions of classes and global functions in the PowerBuilder extension to PowerBuilder. Every…
IPB_Value interface – PB Docs 2017
IPB_Value interface IPB_Value has three sets of methods: helper methods, set methods, and get methods. Helper methods The IPB_Value interface helper methods provide access to information about variables and arguments, including the value’s class and type, whether it is an array or simple type, whether it is set by reference, and whether the null flag…
SetToNull – PB Docs 2017
SetToNull Description Sets the data contained in the IPB_Value instance to null so the data can be reset. Syntax
|
1 |
SetToNull( ) |
Return value PBXRESULT. If the value is a read-only argument, the error PBX_E_READONLY_ARGS is returned. Examples This example shows the use of SetToNull when a null blob value is returned:
|
1 2 3 4 5 6 7 8 |
case pbvalue_blob: pStr=(LPCTSTR)Session-> GetBlob(retVal.blob_val); if (strncmp(pStr, "null", 4)==0 ) ci->returnValue->SetToNull(); else ci->returnValue->SetBlob(retVal.blob_val); break; ... |
See also IsEnum Document…
GetClass – PB Docs 2017
GetClass Description Returns the class handle of a PowerBuilder object. This function is most frequently used to obtain a class handle for use with the GetMethodID function. Syntax
|
1 |
GetClass (pbobject obj) |
Argument Description obj A valid PowerBuilder object handle Return value pbclass or null on error. Examples In this example, GetClass is used to obtain the class…
SetAt – PB Docs 2017
SetAt Description Sets a value or string to the array item at the specified dimension. Syntax For arrays of a specified ValueType:
|
1 |
SetAt(pblong dim[], ValueType v) |
For string arrays:
|
1 2 |
SetAt(pblong dim[], LPCTSTR string) SetAt(pblong dim[], pbstring string) |
Argument Description dim The dimension of the array item to be set v A ValueType defined in pbtraits.h string A string of type pbstring or LPCTSTR Return value…
PBCallInfo structure – PB Docs 2017
PBCallInfo structure The PBCallInfo structure is used to hold data and return type information for calls between extensions and the PBVM. It has three public members:
|
1 2 3 |
IPB_Arguments*   pArgs; IPB_Value*           returnValue; pbclass                   returnClass; |
The following code initializes a PBCallInfo structure using the IPB_Session InitCallInfo method. After allocating a PBCallInfo structure called ci, the IPB_Session GetClass and GetMethodID methods are used to get the class…
Step 1: Decide on a feature to implement – PB Docs 2017
Step 1: Decide on a feature to implement The first step in building a PowerBuilder extension is to identify a problem that an extension can solve. This might be a feature that can be coded more efficiently and easily in C++ than in PowerScript, or that requires the use of callback functions or nonstandard datatypes….