GetClass
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 obj) |
|
Argument |
Description |
|---|---|
|
obj |
A valid PowerBuilder object handle |
Return value
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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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; } |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest