Hi guys,
I'm trying to understand how the struct/union of the VARIANT type is done. See
file <oaidl.h> for VARIANT definition.
I want to implement a more simple VARIANT type for my application, but I want the
same behavior, i.e. if my variable name is var (VARIANT var), I want to be able to
achieve both var.vt = VT_I4 and vt.iVal = 0.
My problem is that if I do a struct like this,
struct
MYVARIANT{
int vt;
union
{
int iVal;
long lVal;
double dVal;
} __MYVARIANT1;
};
var.vt will be visible but not iVal nor lVal nor dVal ... how can I acheive the same implementation
as the VARIANT type
Thanks,
P.A.

Expanding struct/union (VARIANT exemple)
Radith
TPECI
You can use an unnamed union, such as