InitCallInfo

PowerBuilder Native Interface

IPB_Session interface:

InitCallInfo method

Description

Initializes the PBCallInfo structure.

Syntax

InitCallInfo(pbclass cls, pbmethodID mid, PBCallInfo *ci)

Argument

Description

cls

The pbclass containing the method

mid

The pbMethodID returned by GetMethodID

ci

A pointer to a preallocated PBCallInfo structure

Return Values

PBXRESULT. Returns PBX_OK on success, and PBX_E_INVALID_ARGUMENT on failure.

Examples

This example shows the implementation of a TriggerEvent function in a visual class. It takes an event name as an argument, obtains the class and method ID needed to initialize the PBCallInfo structure, triggers the event, and frees the PBCallInfo structure:

void CVisualExt::TriggerEvent(LPCTSTR eventName)
{
   pbclass clz = d_session->GetClass(d_pbobj);
   pbmethodID mid = d_session->GetMethodID(clz,
      eventName, PBRT_EVENT, "I");

   PBCallInfo ci;
   d_session->InitCallInfo(clz, mid, &ci);
   d_session->TriggerEvent(d_pbobj, mid, &ci);
   d_session->FreeCallInfo(&ci);
}

Usage

On return, this method allocates enough space for the arguments, and then initializes the 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

FreeCallInfo