1 #include "tao/DynamicInterface/Request.h"
2 #include "tao/DynamicAny/DynAnyFactory.h"
5 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
10 CORBA::ORB_init (argc
, argv
);
12 ACE_DEBUG ((LM_DEBUG
,"Get reference to the DynAny Factory\n"));
13 CORBA::Object_var obj
=
14 orb
->resolve_initial_references ("DynAnyFactory");
16 DynamicAny::DynAnyFactory_var daf
=
17 DynamicAny::DynAnyFactory::_narrow (obj
.in());
19 UnionIecs::S_i_num s_num
;
20 s_num
.type_num
= UnionIecs::E_type_num_called_party_number
;
23 UnionIecs::S_num num1
;
29 "calling from_any () and to_any () with non-empty union...\n"));
30 DynamicAny::DynAny_var dynany1
=
31 daf
->create_dyn_any_from_type_code (UnionIecs::_tc_S_num
);
33 dynany1
->from_any(MyAny1
);
37 ACE_DEBUG ((LM_DEBUG
, "...done\n"));
39 UnionIecs::S_num num2
;
45 "calling from_any () and to_any () with empty union...\n" ));
46 DynamicAny::DynAny_var dynany2
=
47 daf
-> create_dyn_any_from_type_code (UnionIecs::_tc_S_num
);
49 dynany2
->from_any (MyAny2
);
54 ACE_DEBUG ((LM_DEBUG
,"...done.\nTest passed.\n"));
56 // Finally destroy the ORB
59 catch (const CORBA::Exception
& ex
)
61 ex
._tao_print_exception ("Exception - test failed:\n");