Microsoft Windows CE 3.0  

ITypeInfo::Invoke

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This method invokes a method or accesses a property of an object that implements the interface indicated 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
);

Parameters

pvInstance
Pointer to an instance of the interface described by this type description.
memid
Identifier of the interface member.
wFlags
Flags that describe the context of the invoke call. It is one of the following values:
Value Description
DISPATCH_METHOD The member is accessed as a method. If there is ambiguity, both this and the DISPATCH_PROPERTYGET flag can be set.
DISPATCH_PROPERTYGET The member is retrieved as a property or data member.
DISPATCH_PROPERTYPUT The member is changed as a property or data member.
DISPATCH_PROPERTYPUTREF The member is changed by using a reference assignment, rather than a value assignment. This value is only valid when the property accepts a reference to an object.
pDispParams
Pointer to a structure that contains an array of parameters, an array of DISPIDs for named parameters, and counts of the number of elements in each array.
pVarResult
Should be NULL if the caller does not expect any result. Otherwise, it should be a pointer to the location at which the result is to be stored. If wFlagsspecifies DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, pVarResultis ignored.
pExcepInfo
Points to an exception information structure, which is filled in only if DISP_E_EXCEPTION is returned. If pExcepInfois NULL on input, only an HRESULTerror is returned.
puArgErr
If Invokereturns DISP_E_TYPEMISMATCH, puArgErrindicates the index (within rgvarg) of the parameter with incorrect type. If more than one parameter returns an error, puArgErrindicates only the first parameter with an error. Arguments in pDispParams-> rgvargappear in reverse order, so the first parameter is the one having the highest index in the array. Cannot be NULL.

Return Values

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

Value Description
S_OK Success.
E_INVALIDARG One or more of the parameters 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.
TYPE_E_IOERROR The function could not read from the file.
TYPE_E_INVDATAREAD Invalid data.
TYPE_E_UNSUPFORMAT The type library has an older format.
TYPE_E_REGISTRYACCESS There was an error accessing the system registration database.
TYPE_E_LIBNOTREGISTERED The type library was not found in the system registration database.
TYPE_E_INVALIDSTATE The type library could not be opened.
TYPE_E_WRONGTYPEKIND Type mismatch.
TYPE_E_ELEMENTNOTFOUND The element was not found.
TYPE_E_BADMODULEKIND The module does not support Invoke.
Other return codes Any of the IDispatch::Invokeerrors may also be returned.

Remarks

Use the function ITypeInfo::Invoketo access a member of an object or invoke a method that implements the interface described by this type description. For objects that support the IDispatchinterface, you can use Invoketo implement IDispatch::Invoke.

ITypeInfo::Invoketakes a pointer to an instance of the class. Otherwise, its parameters are the same as IDispatch::Invoke, except that ITypeInfo::Invokeomits the refiidand lcidparameters. When called, ITypeInfo::Invokeperforms the actions described by the IDispatch::Invokeparameters on the specified instance.

For VTBL interface members, ITypeInfo::Invokepasses the LCID of the type information into parameters tagged with the lcidattribute, and the returned value into the retvalattribute.

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

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Oaidl.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.