ICreateTypeInfo::AddVarDesc

This method adds a data member description as a type description.

At a Glance

Header file: Oaidl.h
Windows CE versions: 2.0 and later

Syntax

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

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 Values

One of the values described in the following table is returned.

Value Description
S_OK Success.
STG_E_INSUFFICIENTMEMORY Out of memory.
E_OUTOFMEMORY Out of memory.
E_INVALIDARG One or more of the parameters is invalid.
E_ACCESSDENIED Cannot write to the destination.
TYPE_E_WRONGTYPEKIND Type mismatch.

Remarks

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 member (oInst) of the VARDESC structure is ignored. This attribute is set only when ICreateTypeInfo::LayOut is called. Also, the member identifier members within the VARDESC structures are ignored unless the TYPEKIND of the class is TKIND_DISPATCH.

Any HREFTYPE members 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 member of the ELEMDESC.