CreateContext Method

Example


function CreateContext(strContext: string): boolean;

You can use the CreateContext method of the TRPCBroker component to create a context for your application. To create context, pass an option name in the strContext parameter. If the function returns True, a context was created, and your application can use all RPCs entered in the option's RPC multiple. If the TRPCBroker component is not connected at the time context is created, a connection will be established. If for some reason a context could not be created, the CreateContext method will return False.

Since context is nothing more than a client/server "B"-type option in the OPTION file (#19), standard MenuMan security is applied in establishing a context. Therefore, a context option can be granted to user(s) exactly the same way as regular options are done using MenuMan. Before any RPC can run, it must have a context established for it to on the server. Thus, all RPCs must be registered to one or more "B"-type option(s). This plays a major role in Broker security.

A context can not be established for the following reasons:

An application can switch from one context to another as often as it needs to. Each time a context is created the previous context is overwritten.

information icon See RPC Limits for information about the size of parameters and results that can be passed to and returned from the TRPCBroker component.

information icon Whenever the Broker makes a call to the server, the cursor is automatically changed to the hourglass symbol as seen in other Microsoft compliant software.