UCOMITypeInfo.Invoke Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invokes a method, or accesses a property of an object, that implements the interface described by the type description.
public:
void Invoke(System::Object ^ pvInstance, int memid, short wFlags, System::Runtime::InteropServices::DISPPARAMS % pDispParams, [Runtime::InteropServices::Out] System::Object ^ % pVarResult, [Runtime::InteropServices::Out] System::Runtime::InteropServices::EXCEPINFO % pExcepInfo, [Runtime::InteropServices::Out] int % puArgErr);
public void Invoke (object pvInstance, int memid, short wFlags, ref System.Runtime.InteropServices.DISPPARAMS pDispParams, out object pVarResult, out System.Runtime.InteropServices.EXCEPINFO pExcepInfo, out int puArgErr);
abstract member Invoke : obj * int * int16 * DISPPARAMS * obj * EXCEPINFO * int -> unit
Public Sub Invoke (pvInstance As Object, memid As Integer, wFlags As Short, ByRef pDispParams As DISPPARAMS, ByRef pVarResult As Object, ByRef pExcepInfo As EXCEPINFO, ByRef puArgErr As Integer)
Parameters
- pvInstance
- Object
Reference to the interface described by this type description.
- memid
- Int32
Identifies the interface member.
- wFlags
- Int16
Flags describing the context of the invoke call.
- pDispParams
- DISPPARAMS
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
- Object
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
- EXCEPINFO
Points to an exception information structure, which is filled in only if DISP_E_EXCEPTION
is returned.
- puArgErr
- Int32
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.
Remarks
The values of pDispParams
can be accessed through PtrToStructure.
Valid values for wFlags
are:
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. |
For additional information about ITypeInfo::Invoke
, see the MSDN Library.