InvokeObjectFunction

PowerBuilder Native Interface

IPB_Session interface:

InvokeObjectFunction method

Description

Invokes a class member method.

Syntax

InvokeObjectFunction(pbobject obj, pbmethodID mid, PBCallInfo *ci)

Argument

Description

obj

The pbobject containing the method

mid

The pbMethodID returned by GetMethodID

ci

A pointer to a preallocated PBCallInfo structure

Return Values

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 code invokes the DataWindow Update function and returns its integer return value:

pbclass cls;
pbmethodID mid;
PBCallInfo* ci = new PBCallInfo;
pbint ret_val;

cls = session->GetClass(dwobj);
mid = session->GetMethodID
   (cls, "Update", PBRT_FUNCTION, "I");
session->InitCallInfo(cls, mid, ci);

session->InvokeObjectFunction(dwobj, mid, ci);

ret_val = ci.returnValue->GetInt();
session->FreeCallInfo(ci);
delete ci;
return ret_val;

See Also