ITypeInfo.Invoke Method (Object, Int32, Int16, DISPPARAMS, IntPtr, IntPtr, Int32)

 

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

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

void Invoke(
	object pvInstance,
	int memid,
	short wFlags,
	ref DISPPARAMS pDispParams,
	IntPtr pVarResult,
	IntPtr pExcepInfo,
	out int puArgErr
)

Parameters

pvInstance
Type: System.Object

A reference to the interface described by this type description.

memid
Type: System.Int32

A value that identifies the interface member.

wFlags
Type: System.Int16

Flags that describe the context of the invoke call.

pDispParams
Type: System.Runtime.InteropServices.ComTypes.DISPPARAMS

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

pVarResult
Type: System.IntPtr

A 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 null if no result is desired.

pExcepInfo
Type: System.IntPtr

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

puArgErr
Type: System.Int32

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

The values of the pDispParams parameter can be accessed through the PtrToStructure method.

Valid values for the wFlags parameter are:

Value

Description

DISPATCH_METHOD

The member is accessed as a method. If there is ambiguity, both this flag 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 valid only when the property accepts a reference to an object.

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

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: