PyIDispatch.InvokeTypes

object = InvokeTypes(dispid, lcid , wFlags , resultTypeDesc , typeDescs , args )

Invokes a DISPID, using the passed arguments and type descriptions.

Parameters

dispid : int

The dispid to use. Please see PyIDispatch::Invoke.

lcid : int

The locale ID. Please see PyIDispatch::Invoke.

wFlags : int

Flags for the call. Please see PyIDispatch::Invoke.

resultTypeDesc : tuple

A tuple describing the type of the result. See the comments for more information.

typeDescs : (tuple, ...)

A sequence of tuples describing the types of the parameters for the function. See the comments for more information.

args : object, ...

The args to the function.

Comments

The Microsoft documentation for IDispatch should be used for all params except 'resultTypeDesc' and 'typeDescs'. 'resultTypeDesc' describes the return value of the function, and is a tuple of (type_id, flags). 'typeDescs' describes the type of each parameters, and is a list of the same (type_id, flags) tuple.

item Description
type_idA valid "variant type" constant (eg, VT_I4 | VT_ARRAY, VT_DATE, etc - see VARIANT at MSDN).
flagsOne of the PARAMFLAG constants (eg, PARAMFLAG_FIN, PARAMFLAG_FOUT etc - see PARAMFLAG at MSDN).

Example

An example from the makepy generated file for Word

class Cells(DispatchBaseClass):

...

    def SetWidth(self, ColumnWidth=..., RulerStyle=...):

	return self._oleobj_.InvokeTypes(202, LCID, 1, (24, 0), ((4, 1), (3, 1)),...)

The interesting bits are

resultTypeDesc: (24, 0) - (VT_VOID, <no flags>)

typeDescs: ((4, 1), (3, 1)) - ((VT_R4, PARAMFLAG_FIN), (VT_I4, PARAMFLAG_FIN))

So, in this example, the function returns no value and takes 2 "in" params - ColumnWidth is a float, and RulerStule is an int.