Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / Bug_2503_Regression / common.cpp
blobfeb71ac0c4269e2746c37994e07e0727b28040ca
1 #include "common.h"
2 #include "tao/PortableServer/PortableServer.h"
4 CORBA::ORB_ptr
5 initialize_orb_and_poa(int & argc, ACE_TCHAR * argv[])
7 CORBA::ORB_var orb =
8 CORBA::ORB_init (argc, argv);
10 CORBA::Object_var poa_object =
11 orb->resolve_initial_references("RootPOA");
13 PortableServer::POA_var root_poa =
14 PortableServer::POA::_narrow (poa_object.in ());
16 PortableServer::POAManager_var poa_manager =
17 root_poa->the_POAManager ();
19 poa_manager->activate ();
21 return orb._retn();
24 void report_exception()
26 try
28 throw;
30 catch(CORBA::Exception & ex)
32 ex._tao_print_exception ("CORBA Exception raised:");
34 catch(char const * msg)
36 ACE_ERROR ((LM_ERROR, "Exception (char const*) raised: %s\n",
37 msg));
39 catch(...)
41 ACE_ERROR ((LM_ERROR, "Unknown exception raised\n"));