This method adds a function description as a type description.
At a Glance
Header file: | Oaidl.h |
Windows CE versions: | 2.0 and later |
Syntax
HRESULT AddFuncDesc( unsigned int index, FUNCDESC FAR* pFuncDesc );
Parameters
index
Index of the new FUNCDESC in the type information.
pFuncDesc
Pointer to a FUNCDESC structure that describes the function. The bstrIDLInfo member in the FUNCDESC should be set to NULL for future compatibility.
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 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 de-allocate 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 function 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).