Creating a reference on the client side

To create a local or network service reference from the client side:

  1. Construct a TLocalObjectName object using the name of the service.
    Define the name of the service by instantiating a TLocalObjectType and passing this into the TLocalObjectName constructor.
    This example defines a service name of File Server:
      TLocalObjectType kServiceName = "File Server" ;
      TLocalObjectName nameOfService( kServiceName ) ;
  2. Instantiate a service reference class as appropriate to the service the client wants to connect to.
    If the service is a local service, instantiate a TLocalServiceReference. For network services, instantiate a TNetworkServiceReference. Pass the service name into the service reference constructor.
    This code instantiates a local service reference using the service name defined in the previous step:
      TLocalServiceReference myServiceReference ( nameOfService) ;

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker