[omniORB] Any Type conversion problem

Alex Tingle alex.tingle at bronermetals.com
Thu Mar 25 14:43:44 GMT 2004


It works just fine for me (Linux/g++ 2.95/omniORB3).

-Alex Tingle

--
Dammit Jim, I'm a programmer... not a mind reader!

On 25 Mar 2004, at 14:05, Le Flour Thierry wrote:

> Hi all,
> I am curently working with the Any type.
> I have defined in my .idl a structure as following :
>
>     struct    BrickAndCS
>     {
>         long    brickId;
>         long    CSId;
>     };
>     typedef BrickAndCS BrickCS;
>
> In my C++ code, I try to use the Any type :
> //====================================================
>      BrickCS bcs,*bcs1;
>      bcs.brickId = 100;
>      bcs.CSId = 1000;
>
>      CORBA::Any a;
>      a <<= bcs;
>
>      if (a >>= bcs1)
>      {
>          cout << "Decoded value contained in Any." << endl;
>      }
>      else
>      {
>         cout << "Unknown value contained in Any." << endl;
>      }
>
>     cout << "Brick on Carousel info sent "  <<bcs1->brickId<< " "  <<
> bcs1->CSId << endl;
> //====================================================
> When i run this piece of code, i expect to get 100 and 1000 as values 
> of
>
> BrickCS structure but the results values are 0 and 0.
> What i did wrong ?
> Any idea ?
> In advance, thanks a lot.
>
>  --
> ---------------------------------------------------
> Le Flour Thierry
> Service Informatique
> L.A.P.P. - BP 110, Chemin de Bellevue
> 74941 Annecy le Vieux cedex
>
> Tel : 04.50.09.16.67 - Fax : 04.50.27.94.95
>       04.50.09.16.00
> email: leflour at lapp.in2p3.fr
> ---------------------------------------------------
>
>
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list




More information about the omniORB-list mailing list