2 //=============================================================================
6 * @author Source code used in TAO has been modified and adapted from thecode provided in the book
7 * @author "Advanced CORBA Programming with C++"by Michi Henning and Steve Vinoski. Copyright1999. Addison-Wesley
9 * @author MA. Used with permission ofAddison-Wesley.Modified for TAO by Mike Moran <mm4@cs.wustl.edu>
11 //=============================================================================
16 #include "ace/Log_Msg.h"
18 // The following header is #included automatically by ACE+TAO.
19 // Therefore, they don't need to be included explicitly.
20 //#include <iostream.h>
21 //#include <iomanip.h>
24 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
29 CORBA::ORB_var orb
= CORBA::ORB_init (argc
,
35 ACE_ERROR_RETURN ((LM_ERROR
,
36 "Usage: client IOR_string\n"),
40 // Destringify argv[1].
41 CORBA::Object_var obj
= orb
->string_to_object (argv
[1]);
43 if (CORBA::is_nil (obj
.in ()))
45 ACE_ERROR_RETURN ((LM_ERROR
,
46 "Nil Time reference\n"),
51 Time_var tm
= Time::_narrow (obj
.in ());
53 if (CORBA::is_nil (tm
.in ()))
55 ACE_ERROR_RETURN ((LM_ERROR
,
56 "Argument is not a Time reference\n"),
61 TimeOfDay tod
= tm
->get_gmt ();
65 "Time in Greenwich is ",
66 tod
.hour
< 10 ? "0" : "",
68 tod
.minute
< 10 ? "0" : "",
73 catch (const CORBA::Exception
& ex
)
75 ex
._tao_print_exception ("client: a CORBA exception occurred");
80 ACE_ERROR_RETURN ((LM_ERROR
,
81 "client: an unknown exception was caught\n"),