GetMethodID

PowerBuilder Native Interface

IPB_Session interface:

GetMethodID method

Description

Syntax

GetMethodID(pbclass cls, LPCTSTR methodName, PBRoutineType rt, LPCTSTR signature, pbboolean publicOnly)

Return Values

Examples

BOOL CALLBACK CFontEnumerator::EnumFontProc
(
   LPLOGFONT lplf,
   LPNEWTEXTMETRIC lpntm,
   DWORD FontType,
   LPVOID userData
)
{
   UserData* ud = (UserData*)userData;
   pbclass clz = ud->session->GetClass(ud->object);
   pbmethodID mid = ud->session->GetMethodID(clz,
      "onnewfont", PBRT_EVENT, "IS");

   PBCallInfo ci;
   ud->session->InitCallInfo(clz, mid, &ci);
   pbstring str = ud->session->
      NewString(lplf->lfFaceName);
   ci.pArgs->GetAt(0)->SetPBString(str);
   ud->session->TriggerEvent(ud->object, mid, &ci);
   pbint ret = ci.returnValue->GetInt();
   ud->session->FreeCallInfo(&ci);

   return ret == 1 ? TRUE : FALSE;
}

Usage

See Also