IPB_Session interface:
GetClass method
Description
Returns the class handle of a PowerBuilder object. This function
is most frequently used to obtain a class handle for use with the GetMethodID function.
Syntax
1 |
GetClass (pbobject <span> obj</span>) |
Argument |
Description |
---|---|
obj |
A valid PowerBuilder object handle |
Return Values
pbclass or null on
error.
Examples
In this example, GetClass is used
to obtain the class of a variable of type UserData so
that the class can be used as an argument to the GetMethodID function:
1 |
BOOL CALLBACK CFontEnumerator::EnumFontProc<br>(<br>   LPLOGFONT lplf, <br>   LPNEWTEXTMETRIC lpntm, <br>   DWORD FontType, <br>   LPVOID userData<br>)<br>{<br>   UserData* ud = (UserData*)userData;<br>   pbclass clz = ud->session-><span>GetClass</span>(ud->object);<br>   pbmethodID mid = ud->session->GetMethodID<br>      (clz, "onnewfont", PBRT_EVENT, "IS");<br> <br>   PBCallInfo ci;<br>   ud->session->InitCallInfo(clz, mid, &ci);<br> <br>   pbstring str = ud->session->NewString<br>      (lplf->lfFaceName);<br>   ci.pArgs->GetAt(0)->SetPBString(str);<br>   ud->session->TriggerEvent(ud->object, mid, &ci);<br>  pbint ret = ci.returnValue->GetInt();<br>   ud->session->FreeCallInfo(&ci);<br> <br>   return ret == 1 ? TRUE : FALSE;<br>} |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest