[omniORB] Inserting sequence into an any

Kruczkowski, Marzenna MKruczk@thestar.ca
Wed Dec 18 14:41:01 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.


--==_14502246293421==_
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2A6A3.1C8E19B0"

------_=_NextPart_001_01C2A6A3.1C8E19B0
Content-Type: text/plain;
	charset="iso-8859-1"

Did you include -Wba option when compiling IDL? This option generates stubs
for TypeCode and any.

Marzenna.

-----Original Message-----
From: Mads Pedersen [mailto:mads@mads-p.dk]
Sent: December 18, 2002 4:09 AM
To: omniorb-list@omniorb-support.com
Subject: [omniORB] Inserting sequence into an any

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
_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list

------_=_NextPart_001_01C2A6A3.1C8E19B0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [omniORB] Inserting sequence into an any</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Did you include -Wba option when compiling IDL? This =
option generates stubs for TypeCode and any.</FONT>
</P>

<P><FONT SIZE=3D2>Marzenna.</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Mads Pedersen [<A =
HREF=3D"mailto:mads@mads-p.dk">mailto:mads@mads-p.dk</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: December 18, 2002 4:09 AM</FONT>
<BR><FONT SIZE=3D2>To: omniorb-list@omniorb-support.com</FONT>
<BR><FONT SIZE=3D2>Subject: [omniORB] Inserting sequence into an =
any</FONT>
</P>

<P><FONT SIZE=3D2>Hi everybody!</FONT>
</P>

<P><FONT SIZE=3D2>I have some problems in inserting a sequence into an =
any.</FONT>
</P>

<P><FONT SIZE=3D2>In my IDL interface I have:</FONT>
<BR><FONT SIZE=3D2>typedef sequence&lt;octet&gt; byteSeq;</FONT>
<BR><FONT SIZE=3D2>void publish( in any data );</FONT>
</P>

<P><FONT SIZE=3D2>When calling the publish method I create an =
any:</FONT>
<BR><FONT SIZE=3D2>CORBA::Any anAny;</FONT>
<BR><FONT SIZE=3D2>byteSeq byteSeqOfVarLen( 1 );</FONT>
<BR><FONT SIZE=3D2>byteSeqOfVarLen.length( 1 );</FONT>
<BR><FONT SIZE=3D2>byteSeqOfVarLen[ 1 ] =3D (CORBA::Octet) 2;</FONT>
<BR><FONT SIZE=3D2>anAny &lt;&lt;=3D byteSeqOfVarLen;&nbsp; // *** =
ERROR ***</FONT>
</P>

<P><FONT SIZE=3D2>I use Visual Studio.</FONT>
<BR><FONT SIZE=3D2>The error message is:</FONT>
<BR><FONT SIZE=3D2>error C2678: binary '&lt;&lt;=3D' : no operator =
defined which takes a</FONT>
<BR><FONT SIZE=3D2>left-hand operand of type 'class CORBA::Any' (or =
there is no</FONT>
<BR><FONT SIZE=3D2>acceptable conversion)</FONT>
<BR><FONT SIZE=3D2>In other words, I cannot insert the sequence into =
the any.</FONT>
</P>

<P><FONT SIZE=3D2>Does anyone know how to do this in another =
way?</FONT>
</P>

<P><FONT SIZE=3D2>Greetings,</FONT>
<BR><FONT SIZE=3D2>Mads Pedersen</FONT>
<BR><FONT SIZE=3D2>mads@mads-p.dk</FONT>
<BR><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>omniORB-list mailing list</FONT>
<BR><FONT SIZE=3D2>omniORB-list@omniorb-support.com</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://www.omniorb-support.com/mailman/listinfo/omniorb-list" =
TARGET=3D"_blank">http://www.omniorb-support.com/mailman/listinfo/omnior=
b-list</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C2A6A3.1C8E19B0--


--==_14502246293421==_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Get to know us
http://www.thestar.com - Canada's largest daily newspaper online
http://www.toronto.com - All you need to know about T.O.
http://www.workopolis.com - Canada's biggest job site
http://www.torontostartv.com - Webcasting & Production
http://www.newinhomes.com - Ontario's Largest New Home & Condo Website
http://www.waymoresports.com - Canada's most comprehensive sports site
http://www.tmgtv.ca - Torstar Media Group Television

--==_14502246293421==_--