Partager via


2.2.43 VARDESC

The VARDESC structure is used by an ITypeInfo server or ITypeComp server to describe a data member, constant, or ODL dispinterface property, as specified in sections 3.5.4.1 and 3.7.4.4.

 typedef struct tagVARDESC {
   MEMBERID memid;
   LPOLESTR lpstrReserved;
   [switch_type(VARKIND), switch_is(varkind)] 
     union {
     [case(VAR_PERINSTANCE, VAR_DISPATCH, VAR_STATIC)] 
       ULONG oInst;
     [case(VAR_CONST)] 
       VARIANT* lpvarValue;
   } _vdUnion;
   ELEMDESC elemdescVar;
   WORD wVarFlags;
   VARKIND varkind;
 } VARDESC,
  *LPVARDESC;

memid: MUST be set to the MEMBERID (section 2.2.35) of the data member, the constant, or the ODL dispinterface property. MUST be set to MEMBERID_DEFAULTINST if the VARDESC describes an appobject coclass, as specified in section 2.2.49.8.

lpstrReserved: MUST be set to NULL, and MUST be ignored by the recipient.

_vdUnion: MUST be set to an instance of the type, according to the value in the varkind field.

oInst:

  • VAR_PERINSTANCE: MUST be set to an implementation-specific value<22>

  • VAR_DISPATCH: MUST be set to 0.

  • VAR_STATIC: MUST be set to 0.

lpVarValue: MUST be set to a reference to a VARIANT that specifies the value of the constant.

elemdescVar: MUST contain an ELEMDESC that describes the data member, constant, or ODL dispinterface property and its type, as specified in section 2.2.41.

wVarFlags: MUST be set to a combination of the VARFLAGS bit flags (as specified in 2.2.18), or set to 0. MUST be set to 0 if the VARDESC describes an appobject coclass, as specified in section 2.2.49.8.

varkind: MUST be set to a value of the VARKIND enumeration. MUST be set to VAR_STATIC if the VARDESC describes an appobject coclass, as specified in section 2.2.49.8.