IPBX_UserObject interface

Description

The IPBX_UserObject interface is the ancestor class of the PowerBuilder native classes.

Methods

IPBX_UserObject has two methods: Destroy and Invoke

Destroy

Description

Destroys the current instance of a PowerBuilder native class that inherits from IPBX_UserObject.

Syntax

Destroy( )

Return value

None.

Examples

This example shows how you would call Destroy for the class MyPBNIClass:

void MyPBNIClass::Destroy()
{
delete this;
}

Usage

You must implement this method in the native class after creating an instance of the class and invoking remote methods.

See also

Invoke

Invoke

Description

Calls methods in PowerBuilder native classes.

Syntax

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


Return value

PBXRESULT.PBX_OK for success.

Examples

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;
}

See also

GetMethodID