2 #include "ace/Get_Opt.h"
3 #include "tao/RTCORBA/RTCORBA.h"
4 #include "tao/Strategies/advanced_resource.h"
6 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
22 ACE_ERROR_RETURN ((LM_ERROR
,
34 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
38 // Initialize and obtain reference to the Test object.
39 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
41 if (parse_args (argc
, argv
) != 0)
44 CORBA::Object_var object
= orb
->string_to_object (ior
);
46 Test_var server
= Test::_narrow (object
.in ());
48 if (CORBA::is_nil (server
.in ()))
50 ACE_ERROR_RETURN ((LM_ERROR
,
51 "ERROR: Object reference <%s> is nil\n",
56 // Make an invocation on the obtained Test object.
59 catch (const CORBA::Exception
& ex
)
61 ex
._tao_print_exception ("Caught exception:");