This documentation is archived and is not being maintained.

UCOMITypeInfo.Invoke Method

Invokes a method, or accesses a property of an object, that implements the interface described by the type description.

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)

void Invoke (
	Object pvInstance,
	int memid,
	short wFlags,
	ref DISPPARAMS pDispParams,
	out Object pVarResult,
	out EXCEPINFO pExcepInfo,
	out int puArgErr
void Invoke (
	Object pvInstance, 
	int memid, 
	short wFlags, 
	/** @ref */ DISPPARAMS pDispParams, 
	/** @attribute OutAttribute() */ /** @ref */ Object pVarResult, 
	/** @attribute OutAttribute() */ /** @ref */ EXCEPINFO pExcepInfo, 
	/** @attribute OutAttribute() */ /** @ref */ int puArgErr
JScript does not support passing value-type arguments by reference.



Reference to the interface described by this type description.


Identifies the interface member.


Flags describing the context of the invoke call.


Reference to a structure that contains an array of arguments, an array of DISPIDs for named arguments, and counts of the number of elements in each array.


Reference to the location at which the result is to be stored. If wFlags specifies DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, pVarResult is ignored. Set to a null reference (Nothing in Visual Basic) if no result is desired.


Points to an exception information structure, which is filled in only if DISP_E_EXCEPTION is returned.


If Invoke returns DISP_E_TYPEMISMATCH, puArgErr indicates the index within rgvarg of the argument with incorrect type. If more than one argument returns an error, puArgErr indicates only the first argument with an error.

The values of pDispParams can be accessed through PtrToStructure.

Valid values for wFlags are:




The member is accessed as a method. If there is ambiguity, both this and the DISPATCH_PROPERTYGET flag can be set.


The member is retrieved as a property or data member.


The member is changed as a property or data member.


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.

For additional information about ITypeInfo::Invoke, see the MSDN Library.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0