views:

22

answers:

1

I am trying to inherit from and extend a structure defined in MIDL. I used the same syntax as for interface inheritance i.e

typedef struct stDBIBinVarDataEx
 {
   float x;
 } MYSTRUCT ;

struct struct2 : MYSTRUCT
 {
   float y;
 };

but the compiler generates errors.

A: 

You can't. MIDL isn't a C++ compiler.

You CAN declare struct2 as containing MYSTRUCT:

struct struct2
{
    MYSTRUCT mystruct;
    float y;
}

It's not quite the same thing but it's probably as close as you're going to get.

Larry Osterman