RPC HELP Silent RpcSLogin StartProgSLogin

From VistApedia
Jump to: navigation, search

RPC Broker Help Home

StartProgSLogin Method

The StartProgSLogin method can be used to initiate another program with information sufficient for a Silent Login, or it can be used to launch a standalone program that does not use a TRPCBroker connection. If the program is being used to launch another executable with information for a Silent Login, it is recommended that the CheckCmdLine function be used in the program being launched (since this function does use the command line information to make a Silent Login if possible).

   procedure StartProgSLogin(const ProgLine: String; ConnectedBroker: TRPCBroker);

Argument:

  • ProgLine -- This is the command line that should be used as the basis for launching the executable. It would contain the executable (and path, if not in the working directory or in the system path) and any command line arguments desired. If the ConnectedBroker argument is not nil, then the VistA M Server address, ListenerPort, Division, and ApplicationToken will be added to the command line and the application launched.
  • ConnectedBroker -- This is the instance of the TRPCBroker that should be used to obtain an ApplicationToken for a Silent Login. The VistA M Server address and ListenerPort for this instance will be used as command line arguments for launching the application, so that it will make a connection to the same Server/ListenerPort combination. If the application to be launched is not related to the TRPCBroker, then this argument should be set to nil.


Example 1:

To launch a program, Sample1, with command line arguments xval=’MyData’ and yval=’YourData’, and connect with a Silent Login (which would be handled in Sample1.exe via the CheckCmdLine method):

   MyCommand := ‘C:\Program Files\VISTA\Test1\Sample1.exe xval=MyData yval=YourData’;
   StartProgSLogin(MyCommand, RPCBroker1);

This would result in the following command line being used to launch the application:

   C:\Program Files\VISTA\Test1\Sample1.exe xval=MyData yval=YourData s=ServerName p=9200 d=Division h=AppHandleValue


Example 2:

To launch a program unrelated to TRPCBroker and VistA M Server connections (e.g., Microsoft Notepad), the command line as desired is used as the first argument, and the value nil is used as the second argument:

   MyCommand := ‘Notepad logtable.txt’;
   StartProgSLogin(MyCommand, nil);