다음을 통해 공유


ICreateTypeInfo::AddFuncDesc

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method adds a function description as a type description.

Syntax

HRESULT AddFuncDesc( 
  unsigned int index, 
  FUNCDESC FAR* pFuncDesc
);

Parameters

  • index
    [in] Index of the new FUNCDESC in the type information.
  • pFuncDesc
    [in] Pointer to a FUNCDESC structure that describes the function. The bstrIDLInfo member in the FUNCDESC should be set to NULL for future compatibility.

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 functions within the type information. The first function has an index of zero.

If an index is specified that exceeds one less than the number of functions in the type information, an error is returned. Calling this function does not pass ownership of the FUNCDESC structure to ICreateTypeInfo. Therefore, the caller must still deallocate the FUNCDESC structure.

The passed-in virtual function table (VTBL) member (oVft) of the FUNCDESC is ignored. This attribute is set when ICreateTypeInfo::LayOut is called.

The method AddFuncDesc uses the passed-in member identifier members within each FUNCDESC for classes with TYPEKIND = TKIND_DISPATCH or TKIND_INTERFACE.

If the member identifiers are set to MEMBERID_NIL, AddFuncDesc assigns member identifiers to the functions. Otherwise, the member identifier members within each FUNCDESC are ignored.

Any HREFTYPE members in the FUNCDESC structure must have been produced by the same instance of ITypeInfo for which AddFuncDesc is called.

The get and put accessor functions for the same property must have the same dispatch identifier (DISPID).

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
FUNCDESC
ICreateTypeInfo::LayOut