Structure Inheritance in MIDL

I am trying to inherit and extend the structure defined in MIDL. I used the same syntax as for inheriting ie interfaces

typedef struct stDBIBinVarDataEx
 {
   float x;
 } MYSTRUCT ;

struct struct2 : MYSTRUCT
 {
   float y;
 };

but the compiler generates errors.

+3
source share
1 answer

You can not. MIDL is not a C ++ compiler.

You can declare struct2 as containing MYSTRUCT:

struct struct2
{
    MYSTRUCT mystruct;
    float y;
}

This is not exactly the same, but it is possible as close as you are going to get.

+3
source

Source: https://habr.com/ru/post/1740011/


All Articles