ITypeInfo::Invoke Function
Invokes a method, or accesses a property of an object, that implements the interface described by the type description.
HRESULT Invoke( VOID FAR *pvInstance, MEMBERID memid, unsigned short wFlags, DISPPARAMS FAR *pDispParams, VARIANT FAR *pVarResult, EXCEPINFO FAR *pExcepInfo, unsigned int FAR *puArgErr );
The return value obtained from the returned HRESULT is one of the following:
Return value | Meaning |
|---|---|
S_OK | Success. |
E_INVALIDARG | One or more of the arguments is invalid. |
DISP_E_EXCEPTION | The member being invoked has returned an error HRESULT. If the member implements IErrorInfo, details are available in the error object. Otherwise, the pExcepInfoparameter contains details. |
Other return codes | Any of the IDispatch::Invoke errors may also be returned. |
Use the function ITypeInfo::Invoke to access a member of an object or invoke a method that implements the interface described by this type description. For objects that support the IDispatch interface, you can use Invoke to implement IDispatch::Invoke.
ITypeInfo::Invoke takes a pointer to an instance of the class. Otherwise, its parameters are the same as IDispatch::Invoke, except that ITypeInfo::Invoke omits the refiid and lcid parameters. When called, ITypeInfo::Invoke performs the actions described by the IDispatch::Invoke parameters on the specified instance.
For VTBL interface members, ITypeInfo::Invoke passes the LCID of the type information into parameters tagged with the lcid attribute, and the returned value into the retval attribute.
If the type description inherits from another type description, this function recurses on the base type description to find the item with the requested member ID.