InvokeClassFunction
Description
Invokes system or user global functions.
Syntax
|
1 |
InvokeClassFunction(pbclass cls, pbmethodID mid, PBCallInfo *ci) |
|
Argument |
Description |
|---|---|
|
cls |
The class that contains the global function. If |
|
mid |
The pbMethodID returned by |
|
ci |
A pointer to a preallocated PBCallInfo |
Return value
PBXRESULT. Returns PBX_OK for success, or one of the following for
failure:
PBX_E_INVALID_ARGUMENT
PBX_E_INVOKE_METHOD_INACCESSABLE
PBX_E_INVOKE_WRONG_NUM_ARGS
PBX_E_INVOKE_REFARG_ERROR
PBX_E_INVOKE_METHOD_AMBIGUOUS
PBX_E_INVOKE_FAILURE
PBX_E_INVOKE_FAILURE
Examples
This example gets the PowerBuilder system class and uses it to
invoke the double function:
|
1 2 3 4 5 |
cls = session-> GetSystemClass(); mid = session-> GetMethodID (cls, "double", PBRT_FUNCTION, "DA"); session-> InitCallInfo(cls, mid, ci); ci->pArgs -> GetAt(0) -> SetPBString(mystr); session -> InvokeClassFunction(cls, mid, ci); |
Usage
On return, this method allocates enough spaces for the arguments,
and then initializes arguments and return value. You must set
appropriate values in the PBCallInfo structure. Note that the structure
itself must have been allocated before the call.
See also