NewProxyObject

PowerBuilder Native Interface

IPB_Session interface:

NewProxyObject method

Description

Creates a proxy for a remote object. The proxy is used to extend the network protocol in PowerBuilder.

Syntax

NewProxyObject(pbclass cls)

Argument

Description

cls

The type of object or structure instance to be created

Return Values

pbproxyobject.

Examples

This example creates a new proxy object, creates a marshaler, and associates the marshaler with the proxy object:

pbproxyObject proxy = session->NewProxyObject(cls);
if (proxy == NULL)
{
   ci->returnValue->SetLong(kFailToCreateProxy);
   return PBX_OK;
}

// Create MyMarshaler
MyMarshaler* marshaler = new MyMarshaler(env,
   proxy, obj);

// Associate MyMarshaler with the proxy
session->SetMarshaler(proxy, marshaler);

ci->pArgs->GetAt(0)->SetObject(proxy);

ci->returnValue->SetLong(kSuccessful);

return PBX_OK;

See Also