Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / examples / Simple / time-date / Time_Date_Client_i.cpp
blob8197bff6401256a3969ca4cb23e6781f3adf89bd
1 #include "Time_Date_Client_i.h"
2 #include "ace/Get_Opt.h"
3 #include "ace/Read_Buffer.h"
5 // This is the interface program that accesses the remote object
7 // Constructor.
8 Time_Date_Client_i::Time_Date_Client_i ()
12 //Destructor.
13 Time_Date_Client_i::~Time_Date_Client_i ()
17 int
18 Time_Date_Client_i::parse_args (int,
19 ACE_TCHAR *[])
21 return 0;
24 int
25 Time_Date_Client_i::run (const char *name,
26 int argc,
27 ACE_TCHAR *argv[])
29 // Initialize the client.
30 if (client_.init (name, argc, argv) == -1)
31 return -1;
33 if (this->parse_args (argc, argv) == -1)
34 return -1;
36 try
38 CORBA::Long l;
40 // Get the time & date in binary format.
41 client_->bin_date (l);
43 ACE_DEBUG ((LM_DEBUG,
44 ACE_TEXT ("(%P|%t) Binary time_date = %d\n"),
45 l));
47 // Get the time & date in string format.
48 CORBA::String_var str_var;
49 client_->str_date (str_var.out());
51 ACE_DEBUG ((LM_DEBUG,
52 ACE_TEXT ("(%P|%t) String time_date = %C\n"),
53 str_var.in()));
55 if (client_.do_shutdown () == 1)
56 client_->shutdown ();
58 catch (const CORBA::UserException& range_ex)
60 range_ex._tao_print_exception ("\tFrom get and set time_date");
61 return -1;
63 catch (const CORBA::SystemException& memex)
65 memex._tao_print_exception ("Cannot make time_date");
66 return -1;
69 return 0;