IPB_Session interface

PowerBuilder Native Interface

IPB_Session interface

Description

The IPB_Session interface is used to interoperate with PowerBuilder. An abstract interface, it defines methods for accessing PowerScript data, calling PowerScript functions, catching and throwing PowerScript exceptions, and setting a marshaler to convert PowerBuilder data formats to the user's communication protocol.

Methods

This table lists functions by category. Full descriptions in alphabetic order follow the table.

Table 7-2: IPB_Session methods by category

Purpose

Method

Description

Managing sessions

Release

Releases this IPB session. The IPB_Session object becomes invalid after the call.

Managing object references

AddGlobalRef

Adds a global reference to the specified PowerBuilder object.

AddLocalRef

Adds a local reference to the specified PowerBuilder object.

NewObject

Creates a new object of the specified type.

PopLocalFrame

Pops the current local reference frame from the current native method stack frame.

PushLocalFrame

Pushes a local reference frame onto the current native method stack frame.

RemoveGlobalRef

Removes a global reference to the specified PowerBuilder object.

RemoveLocalRef

Removes a local reference to the specified PowerBuilder object.

Managing shared properties

GetProp

Retrieves a pointer to the data value of a variable that has been registered as a shared property for the current IPB session.

RemoveProp

Removes the specified variable from the list of properties of the current IPB session.

SetProp

Adds a new variable to the list of properties of the current session or changes the value of an existing variable.

Handling the PowerBuilder message queue

ProcessPBMessage

Checks the PowerBuilder message queue and, if there is a message in the queue, attempts to process it.

Handling exceptions

ClearException

Clears the current PowerBuilder exception object.

GetException

Obtains the current thrown exception object.

HasExceptionThrown

Checks for the existence of an exception that has been thrown but not cleared.

ThrowException

Throws a PowerBuilder exception or inherited exception, replacing the existing exception if one exists.

Passing arguments

Add<type>Argument

Adds an argument in a variable argument PowerBuilder call.

FreeCallInfo

Frees memory allocated by InitCallInfo.

InitCallInfo

Initializes the PBCallInfo structure.

Finding PowerBuilder classes and objects

FindGroup

Searches for a group with a given name and group type in the current library list.

FindClass

Searches for a class with a given name within a given group.

FindClassByClassID

Searches for a class with a given name and a given ID.

GetClass

Returns the class handle of a PowerBuilder object.

GetClassName

Returns the name of a class in lowercase.

GetCurrGroup

Returns the name of the current group.

GetSuperClass

Returns the base class of a class, if any.

GetSystemClass

Returns the system class handle of a PowerBuilder object.

GetSystemGroup

Returns the class that contains all the system global functions.

IsAutoInstantiate

Returns true if the specified class is an autoinstantiated class; otherwise returns false.

Working with functions and events

FindMatchingFunction

Finds a function that has the specified argument list.

GetMethodID

Returns the ID of the requested function.

GetMethodIDByEventID

Returns the ID of the function that has a given predefined PowerBuilder event ID.

InvokeClassFunction

Invokes system or user global functions.

InvokeObjectFunction

Invokes a class member function.

TriggerEvent

Triggers a PowerBuilder event.

Working with enumerated variables

GetEnumItemName

Obtains the name of an enumerated variable.

GetEnumItemValue

Obtains the value of an enumerated variable.

Working with global variables

GetGlobalVarID

Returns the name of a global variable.

GetGlobalVarType

Returns the datatype of a global variable.

Get<type>GlobalVar

Returns the value of a global variable of a specific datatype.

GetPBAnyGlobalVar

Obtains the value of a global variable of type Any.

IsGlobalVarArray

Returns true if the global variable contains an array, otherwise returns false.

IsGlobalVarNull

Returns true if the global variable contains a null value, otherwise returns false.

IsGlobalVarObject

Returns true if the global variable contains a pbobject, otherwise returns false.

Set<type>GlobalVar

Sets the value of a global variable of a specific datatype.

SetGlobalVarToNull

Sets the value of a shared variable to null.

Working with shared variables

GetSharedVarID

Returns the name of a shared variable.

GetSharedVarType

Returns the datatype of a shared variable.

Get<type>SharedVar

Returns the value of a shared variable of a specific datatype.

GetPBAnySharedVar

Obtains the value of a shared variable of type Any.

IsSharedVarArray

Returns true if the shared variable contains an array, otherwise returns false.

IsSharedVarNull

Returns true if the shared variable contains a null value, otherwise returns false.

IsSharedVarObject

Returns true if the shared variable contains a pbobject, otherwise returns false.

Set<type>SharedVar

Sets the value of a shared variable of a specific datatype.

SetSharedVarToNull

Sets the value of a shared variable to null.

Working with arrays

Get<type>ArrayItem

Returns the value of an array item of a specific datatype.

GetArrayInfo

Obtains information about an array.

GetArrayItemType

Obtains the datatype of an item in an array.

GetArrayLength

Returns the length of an array.

GetPBAnyArrayItem

Obtains the value of an array item of type Any.

IsArrayItemNull

Returns true if the array item contains an array, otherwise returns false.

NewBoundedSimpleArray

Creates a bounded simple data array.

NewUnboundedSimpleArray

Creates an unbounded simple data array.

NewBoundedObjectArray

Creates a bounded PowerBuilder object or structure array.

NewUnboundedObjectArray

Creates an unbounded PowerBuilder object or structure data array.

ReleaseArrayInfo

Releases memory returned by GetArrayInfo.

Set<type>ArrayItem

Sets the value of an array item of a specific datatype.

SetArrayItemToNull

Sets the value of an array item to null.

Working with strings

GetStringLength

Returns the length of a string in bytes without the terminator.

GetString

Returns a pointer to the string passed in as an argument.

NewString

Creates a new string.

ReleaseString

Releases the memory used by a string.

SetString

Frees an existing string and assigns a new string value to it.

Working with binary large objects

GetBlob

Returns a pointer to the data buffer for a blob.

GetBlobLength

Returns the length in bytes of blob data in a buffer.

NewBlob

Creates a new blob and duplicates a buffer for the new blob data.

SetBlob

Destroys the existing data in a blob and copies data into it from a buffer.

Working with decimal values

GetDecimalString

Converts decimal data in a pbdec object to a string.

NewDecimal

Allocates resources for a new decimal data object.

ReleaseDecimalString

Frees the memory acquired using GetDecimalString.

SetDecimal

Converts a string to a decimal.

Working with date and time values

GetDateString

Converts data in a pbdate object to a string.

GetDateTimeString

Converts data in a pbdatetime object to a string.

GetTimeString

Converts data in a pbtime object to a string.

NewDate

Creates a new pbdate data object.

NewDateTime

Creates a new pbdatetime data object.

NewTime

Creates a new pbtime data object.

ReleaseDateString

Frees the memory acquired using GetDateString.

ReleaseDateTimeString

Frees the memory acquired using GetDateTimeString.

ReleaseTimeString

Frees the memory acquired using GetTimeString.

SetDate

Resets the value of the specified pbdate object.

SetDateTime

Resets the value of the specified pbdatetime object.

SetTime

Resets the value of the specified pbtime object.

SplitDate

Splits the specified pbdate object into a year, month, and day.

SplitDateTime

Splits the specified pbdatetime object into a year, month, and day.

SplitTime

Splits the specified pbtime object into a year, month, and day.

Working with data values

AcquireArrayItemValue

Clones the data in the PBCallInfo structure in an array item and resets the IPB_Value pointer.

AcquireValue

Clones the data in the PBCallInfo structure and resets the IPB_Value pointer.

ReleaseValue

Frees the value acquired by the AcquireValue or AcquireArrayItemValue method.

SetValue

Sets the value of one IPB_Value object to the value of another IPB_Value object

Working with fields

GetFieldID

Obtains the internal ID of a class instance variable.

GetFieldName

Obtains the name of the specified field.

GetFieldType

Obtains the datatype of a class instance variable.

GetNumOfFields

Obtains the number of fields in the specified class.

GetPBAnyField

Obtains the value of a variable of type Any.

Get<type>Field

Obtains a pointer to the instance variable data for a specified variable.

IsFieldArray

Returns true if the field contains an array, otherwise returns false.

IsFieldNull

Returns true if the field contains a null value array, otherwise returns false.

IsFieldObject

Returns true if the field contains a pbobject, otherwise returns false.

Set<type>Field

A set of datatype-specific functions. Sets the value of an instance field of an object.

Set<type>Field

A set of datatype-specific functions. Sets the value of an instance field of an object.

UpdateField

Refreshes a visual property of a PowerBuilder object.

Working with native classes

GetNativeInterface

Obtains a pointer to the interface of a native class.

IsNativeObject

Determines whether a pbobject is an instance of a native class.

Accessing result sets from DataWindows and DataStores

CreateResultSet

Creates a result set object using a pointer to an IPB_ResultSetAccessor object.

GetResultSetAccessor

Obtains an interface through which you can read data from a result set.

ReleaseResultSetAccessor

Releases the pointer obtained using GetResultSetAccessor.

Working with marshaler extensions

GetMarshaler

Obtains the marshaler object associated with a proxy object.

NewProxyObject

Creates a proxy for a remote object.

SetMarshaler

Sets a marshaler that will be used to invoke remote methods and convert PowerBuilder data formats to the user's communication protocol.