2 #include "tao/CodecFactory/CodecFactory.h"
4 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
8 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
9 CORBA::Object_var object
=
10 orb
->resolve_initial_references("CodecFactory");
12 IOP::CodecFactory_var codec_factory
=
13 IOP::CodecFactory::_narrow(object
.in ());
14 IOP::Encoding e
= {IOP::ENCODING_CDR_ENCAPS
,1,2};
16 IOP::Codec_var codec
= codec_factory
->create_codec(e
);
19 Value
* value
= new OBV_Value
;
22 CORBA::OctetSeq_var bin
= codec
->encode(any_o
);
23 CORBA::Any_var any_n
= codec
->decode(bin
.in ());
25 catch (const CORBA::Exception
& ex
)
27 ex
._tao_print_exception ("Caught a CORBA exception\n");