Tutorial: Building an Rogue Wave Server Application > Designing the Server Object Model > Registering Server Objects
 
Registering Server Objects
When an object server is started, you can open views of that server from an application component in two different ways. You can:
*supply the identifier of the server object from which the representation must be built. This implies that the object supplied has been previously declared to the server as explained below. (See “Connecting to the Network Object Server”..)
*click on a hyper-reference from a view that is already open. For details on hyper-references, see “Hyper-References”..
To open a view from an application component when no view is open, you must declare at least one object to the server by using the function IlsMvServer::DeclObjectLabel and associate it with a string identifier.
In the Network example, the BuildNetwork function creates a test network and declares it together with all its domains to the server:
NetworkP BuildNetwork()
   NetworkP network=new Network(“MyNetwork”);
   DomainP* domainT=new DomainP[domainNb];
   ...
   IlsMvServer::DeclObjectLabel(*network,”MyNetwork”);
   for (i=domainNb;i>0;i--){
      char nm[10];
      sprintf(nm,”Domain#%d”,i);
      domainT[i-1]=new Domain(nm);
      IlsMvServer::DeclObjectLabel(*domainT[i-1],nm);
      network->domains << domainT[i-1];
   }
   ...
   return network;
}

Version 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.