ICreateTypeInfo::AddVarDesc

HRESULT AddVarDesc(
  unsigned int  index,    
  VARDESC FAR*  pVarDesc  
);
 

Adds a variable or data member description to the type description.

Parameters

index
Index of the variable or data member to be added to the type description.
pVarDesc
Pointer to the variable or data member description to be added.

Return Value

The return value of the returned HRESULT is one of the following:

Return value Meaning
S_OK Success.
STG_E_INSUFFICIENTMEMORY Out of memory.
E_OUTOFMEMORY Out of memory.
E_INVALIDARG One or more of the arguments is invalid.
E_ACCESSDENIED Cannot write to the destination.
TYPE_E_WRONGTYPEKIND Type mismatch.

Comments

The index specifies the order of the variables. The first variable has an index of zero. ICreateTypeInfo::AddVarDesc returns an error if the specified index is greater than the number of variables currently in the type information. Calling this function does not pass ownership of the VARDESC structure to ICreateTypeInfo. The instance field (oInst) of the VARDESC structure is ignored. This attribute is set only when ICreateTypeInfo::LayOut is called. Also, the member ID fields within the VARDESCs are ignored unless the TYPEKIND of the class is TKIND_DISPATCH.

Any HREFTYPE fields in the VARDESC structure must have been produced by the same instance of ITypeInfo for which AddVarDesc is called.

AddVarDesc ignores the contents of the idldesc field of the ELEMDESC.