Previous Table of Contents Next


11.6.5 Creating References before Activation


   It is sometimes useful to create references for objects before activating them. This example extends the previous example to illustrate this option:

   // C++PortableServer::ObjectId_var oid =PortableServer::string_to_ObjectId(“myLittleFoo?);CORBA::Object_var obj = poa->create_reference_with_id(

   oid.in(), “IDL:Foo:1.0?);Foo_var foo = Foo::_narrow(obj);

   // ...later...MyFooServant* afoo = new MyFooServant(poa, 27);poa->activate_object_with_id(oid.in(), afoo);