Difference between revisions of "RPC HELP DLL GuideLines VB Connect to the Server"

From VistApedia
Jump to: navigation, search
(Created page with " RPC Broker Help Home DLL Interface Home <h2>Visual Basic: Connect to the Server</h2> To connect to the VistA M Ser...")
 
 
Line 19: Line 19:
 
     RPCBPropGet(intRPCBHandle, "Connected", strResult)
 
     RPCBPropGet(intRPCBHandle, "Connected", strResult)
  
4. Attempt to create context for your application's "B"-type option. If you can't create context, you should quit or branch accordingly. If [[RPC_HELP_DLL_ExportFN_RPCBCreateContext|RPCBCreateContext]] returns True, then you are ready to call all RPCs registered to your application's "B"-type option:
+
'''4.''' Attempt to create context for your application's "B"-type option. If you can't create context, you should quit or branch accordingly. If [[RPC_HELP_DLL_ExportFN_RPCBCreateContext|RPCBCreateContext]] returns True, then you are ready to call all RPCs registered to your application's "B"-type option:
  
 
     intResult = RPCBCreateContext(intRPCBHandle, "MY APPLICATION")
 
     intResult = RPCBCreateContext(intRPCBHandle, "MY APPLICATION")

Latest revision as of 16:45, 8 July 2015

RPC Broker Help Home

DLL Interface Home

Visual Basic: Connect to the Server

To connect to the VistA M Server from your Visual Basic program:

1. Set the server and port to connect to:

   Call RPCBPropSet(intRPCBHandle, "Server", "BROKERSERVER")
   Call RPCBPropSet(intRPCBHandle, "ListenerPort", "9200")

2. Set the Connected property to true; this attempts a connection to the VistA M Server:

   Call RPCBPropSet(intRPCBHandle, "Connected", "1")

3. Check if you are still connected. If so, you can continue (your connection was made). If not, you should quit or branch accordingly:

   RPCBPropGet(intRPCBHandle, "Connected", strResult)

4. Attempt to create context for your application's "B"-type option. If you can't create context, you should quit or branch accordingly. If RPCBCreateContext returns True, then you are ready to call all RPCs registered to your application's "B"-type option:

   intResult = RPCBCreateContext(intRPCBHandle, "MY APPLICATION")