[omniORB] Inserting sequence into an any

Mads Pedersen mads@mads-p.dk
Wed Dec 18 09:08:01 2002


Hi everybody!

I have some problems in inserting a sequence into an any.

In my IDL interface I have:
typedef sequence<octet> byteSeq;
void publish( in any data );

When calling the publish method I create an any:
CORBA::Any anAny;
byteSeq byteSeqOfVarLen( 1 );
byteSeqOfVarLen.length( 1 );
byteSeqOfVarLen[ 1 ] = (CORBA::Octet) 2;
anAny <<= byteSeqOfVarLen;  // *** ERROR ***

I use Visual Studio.
The error message is:
error C2678: binary '<<=' : no operator defined which takes a 
left-hand operand of type 'class CORBA::Any' (or there is no 
acceptable conversion)
In other words, I cannot insert the sequence into the any.

Does anyone know how to do this in another way?

Greetings,
Mads Pedersen
mads@mads-p.dk