2 #include "Stock_Factory_i.h"
3 #include "ace/streams.h"
5 int ACE_TMAIN (int argc
, ACE_TCHAR
* argv
[])
8 // First initialize the ORB, that will remove some arguments...
10 CORBA::ORB_init (argc
, argv
);
11 CORBA::Object_var poa_object
=
12 orb
->resolve_initial_references ("RootPOA");
13 PortableServer::POA_var poa
=
14 PortableServer::POA::_narrow (poa_object
.in ());
15 PortableServer::POAManager_var poa_manager
=
16 poa
->the_POAManager ();
17 poa_manager
->activate ();
20 Quoter_Stock_Factory_i stock_factory_i
;
22 // Activate it to obtain the object reference
23 Quoter::Stock_Factory_var stock_factory
=
24 stock_factory_i
._this ();
26 // Put the object reference as an IOR string
27 CORBA::String_var ior
= orb
->object_to_string (stock_factory
.in ());
30 cout
<< ior
.in () << endl
;
34 // Destroy the POA, waiting until the destruction terminates
35 poa
->destroy (true, true);
38 catch (const CORBA::Exception
&) {
39 cerr
<< "CORBA exception raised!" << endl
;