[omniORB] sequence problem

Gilbert Chang gchang@ccnet.com
Thu, 18 Jun 1998 21:00:07 -0700



Goran Karlsson wrote:

> Hi,
>
> I am using omniORB_2.5.0 on Linux 2.0.27 and Win95 (VC++ 5.0) platforms,
> and the echo examples work fine on both.
>
> The Problem:
>
> I tried the following IDL file:
>
> struct Details {
>   string Name;
>   long Number;
> };
>
> typedef sequence<Details> DetailsList;
>
> interface Echo {
>   DetailsList echoseq();
> };
>
> and for instance the following code in my application:
>
> DetailsList * list = new DetailsList(2);
>
> (*list)[0].Name = "foo";
> (*list)[0].Number = 33;
> and so on ....
>
> It compiles and links fine on both platforms (Linux and Win95).
> When running the code the Linux code stops with the following message:
> IOT trap/Abort
>
> The Win95 stops with the message:
> Unhandled exception in ex2.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++
> Exception.
>
> Both platforms stop at the first occurence of (*list)[0].Name = "foo";
>
> The overloaded [] operator seems to be the trouble. As I am new to omniORB
> and CORBA I would appreciate any help to solve the problem.

I think you need to do:
(*list)[0].Name = (const char *)"foo";