Struct inheritance in MIDL
-
24-09-2019 - |
Question
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.
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow