InitCallInfo
Description
Initializes the PBCallInfo structure.
Syntax
|
1 |
InitCallInfo(pbclass cls, pbmethodID mid, PBCallInfo *ci) |
|
Argument |
Description |
|---|---|
|
cls |
The pbclass containing the method |
|
mid |
The pbMethodID returned by |
|
ci |
A pointer to a preallocated PBCallInfo |
Return value
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:
|
1 2 3 4 5 6 7 8 9 10 11 |
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