Product: OpenFusion TAO
Version: ALL
Description:
DynamicAny::DynEnum has two methods
Resolution:
DynamicAny::DynEnum has two methods to give you the value for your enum:
- get_as_string()which returns a new CORBA::String object with a COPY of the textual "Name"
of the constant (so this needs to be tidied up when it is no longer needed or goes out of scope).
- get_as_ulong() which returns a CORBA::ULong with the numeric value of the constant (which is what you were originally attempting to obtain).
The alternative is to use tao_idl on your interface.idl file and include the actual type into your test_idl.cpp code so that the actual enum type (ISP::Color) can be extracted into, and then it's numeric value may be directly obtained from that actual enum type via normal C/C casting.
#OpenFusion
#KnowledgeDocs