2.2.37 TYPEDESC

The TYPEDESC structure is used in the ARRAYDESC, ELEMDESC, and TYPEATTR structures to identify and describe the type of a data member, the return type of a method, or the type of a method parameter.

 typedef struct tagTYPEDESC {
   [switch_type(USHORT), switch_is(vt)] 
     union {
     [case(VT_PTR, VT_SAFEARRAY)] 
       struct tagTYPEDESC* lptdesc;
     [case(VT_CARRAY)] 
       struct tagARRAYDESC* lpadesc;
     [case(VT_USERDEFINED)] 
       HREFTYPE hreftype;
     [default]       ;
   } _tdUnion;
   USHORT vt;
 } TYPEDESC;

_tdUnion: MUST contain an instance of the type, according to the VARENUM value provided in the vt field.

lptdesc: MUST refer to a TYPEDESC that specifies the element type. If the ELEMDESC is contained in a VARDESC that describes an appobject coclass, the TYPEDESC MUST specify the type of the coclass.

lpadesc: MUST refer to an ARRAYDESC that describes a fixed-length array.

hreftype: MUST be set to an HREFTYPE that identifies the UDT (see section 2.2.28).

vt: MUST be set to one of the values that are specified as available to a TYPEDESC and identified with a "T" in the Context column of the table in 2.2.7. MUST be set to VT_PTR if the ELEMDESC is contained in a VARDESC that describes an appobject coclass, as specified in section 2.2.49.8.