CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); PortableServer::POAManager_var mgr = poa->the_POAManager(); mgr->activate();
MyServant_impl* servant = new MyServant_impl(); PortableServer::ServantBase_var servant_var(servant); poa->activate_object(servant_var);This code creates a new servant object of type MyServant_impl, then activates it for the POA object stored in the poa variable. The cpp portableserver library is part of the CORBA package, which provides a standard mechanism for implementing distributed object systems in C++.