Share via


ICreateTypeInfo::AddVarDesc

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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

Syntax

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

Parameters

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

Return Value

The following table shows the return values for this function.

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. 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.

Requirements

Header oaidl.h, oaidl.idl
Library oleaut32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

ICreateTypeInfo
ELEMDESC
ICreateTypeInfo::LayOut
ITypeInfo
VARDESC