lrc_DispMethod
| IDispatch Interface Calls |
Invokes a method of an interface using the IDispatch:Invoke method.
VARIANT lrc_DispMethod( IDispatch * pDispatch, char *idName, unsigned long locale, ...);
| *pDispatch | A pointer to the IDispatch interface. |
| *idName | A pointer to the name of the method to invoke. |
| locale | The language locale. |
Additional Arguments
| Args | A list of the required arguments of the method (the unnamed arguments of the DispParams structure in the original Microsoft definition). |
| OPTIONAL_ARGS | An optional flag signaling that the next arguments will be a series of pairs of optional arguments, with each pair giving the name and the value of the argument (the named arguments of the DispParams structure in the original Microsoft definition). |
| LAST_ARG | A flag signaling that the preceding argument was the last argument. |
| __CheckResult | This flag is generated by VuGen to indicate if the call was successful when the script was generated and HRESULT should be checked. Values: CHECK_HRES or DONT_CHECK_HRES. |
The lrc_DispMethodfunction invokes a method of an interface using the IDispatch:Invoke method. The lrc_DispMethod call sets wflags to DISPATCH_METHOD.
Calls to GetIDsOfNames are hidden inside the lrc_Dispcalls.The lrc_DispMethod returns the return value of the invoked function.
IDispatch is a "meta-interface" that exposes all of the other interfaces and methods of a COM object.
Return Values
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
This example shows how to use lrc_Dispmethod with optional arguments.
GUID riid = IID_IDispatch;
lrc_IOptional_QueryInterface(IOptional_0, &riid,(void**)&IOptional_0, CHECK_HRES);
VARIANT P1 = lrc_variant_short("47");
VARIANT P2 = lrc_variant_short("37");
VARIANT P3 = lrc_variant_date("3/19/1901");
VARIANT var3 = lrc_variant_scode("4");
lrc_DispMethod((IDispatch*)IOptional_0, "in_out_optional_args", /*locale*/1024, &P1, &P2, OPTIONAL_ARGS, "#3", &P3, "var3", &var3, LAST_ARG, CHECK_HRES);

