The IPBX_UserObject interface is the ancestor class of the PowerBuilder native classes.
IPBX_UserObject has two methods:Destroy and Invoke
Destroys the current instance of a PowerBuilder native class that inherits from IPBX_UserObject.
Destroy( )
None.
This example shows how you would call Destroy for the class MyPBNIClass:
void MyPBNIClass::Destroy()
{
delete this;
}
You must implement this method in the native class after creating an instance of the class and invoking remote methods.
Calls methods in PowerBuilder native classes.
Invoke(IPB_Session * session, pbobject obj, pbmethodID mid, PBCallInfo *ci)
Argument |
Description |
|---|---|
session |
This IPB session |
obj |
The PowerBuilder extension object to be invoked |
mid |
The pbMethodID returned by GetMethodID |
ci |
The parameters and return value setting for the call |
PBXRESULT.PBX_OK for success.
In this example, the method invoked depends on the value (0, 1, or 2) of the method ID returned from the GetMethodID method:
PBXRESULT PBNIExt::Invoke
(
IPB_Session *session,
pbobject obj,
pbmethodID mid,
PBCallInfo *ci
)
{
PBXRESULT result = PBX_OK;
switch (mid)
{
case mFuncA:
result = FuncA(session, obj, ci);
break;
case mFuncB:
result = FuncB(session, obj, ci);
break;
case mFuncC:
result = FuncC(session, obj, ci);
break;
default:
result = PBX_E_INVOKE_FAILURE;
break;
}
return PBX_OK;
}