[omniORB] Date: Mon, 4 Sep 2000 11:51:50 +0200

Duncan Grisby dgrisby@uk.research.att.com
Mon, 04 Sep 2000 12:38:44 +0100


On Monday 4 September, Dempsey Shane wrote:

> struct TestStruct
> {
> string Test;
> };
>  
> I end up getting the following error message: 
> 
> Hello_i.cc(132) : error C2555: 'CScreen_Field_i::GetTestStruct' : overriding
> vir
> tual function differs from '_sk_CScreen_Field::GetTestStruct' only by return
> typ
> e or calling convention
> Hello_impl.cc(25) : error C2259: 'CScreen_Field_i' : cannot instantiate
> abstract

You have tried to define your servant class with the wrong return
type. For a variable length struct, you must return a pointer to the
struct type:

  class CScreen_Field_i : _sk_CScreen_Field {
    ...
    TestStruct* GetTestStruct();
    ....
  };

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --