COleDispatchDriver::InvokeHelper

voidInvokeHelper(DISPIDdwDispID**,WORDwFlags,VARTYPEvtRet,void*pvRet,constBYTEFAR*pbParamInfo,...);**
throw( COleException );
throw( COleDispatchException );

Parameters

dwDispID

Identifies the method or property to be invoked. This value is usually supplied by ClassWizard.

wFlags

Flags describing the context of the call to . For possible values, see the Platform SDK.

vtRet

Specifies the type of the return value. For possible values, see the Remarks section.

pvRet

Address of the variable that will receive the property value or return value. It must match the type specified by vtRet.

pbParamInfo

Pointer to a null-terminated string of bytes specifying the types of the parameters following pbParamInfo.

...

Variable list of parameters, of types specified in pbParamInfo.

Remarks

Calls the object method or property specified by dwDispID, in the context specified by wFlags. The pbParamInfo parameter specifies the types of the parameters passed to the method or property. The variable list of arguments is represented by ... in the syntax declaration.

Possible values for the vtRet argument are taken from the VARENUM enumeration. Possible values are as follows:

Symbol Return Type
VT_EMPTY void
VT_I2 short
VT_I4 long
VT_R4 float
VT_R8 double
VT_CY CY
VT_DATE DATE
VT_BSTR BSTR
VT_DISPATCH LPDISPATCH
VT_ERROR SCODE
VT_BOOL BOOL
VT_VARIANT VARIANT
VT_UNKNOWN LPUNKNOWN

The pbParamInfo argument is a space-separated list of VTS_ constants. One or more of these values, separated by spaces (not commas), specifies the function’s parameter list. Possible values are listed with the EVENT_CUSTOM macro.

This function converts the parameters to VARIANTARG values, then invokes the method. If the call to Invoke fails, this function will throw an exception. If the SCODE (status code) returned by IDispatch::Invoke is DISP_E_EXCEPTION, this function throws a COleException object; otherwise it throws a COleDispatchException.

For more information, see , , , and in the Platform SDK.

Example

See the example for COleDispatchDriver::CreateDispatch.

COleDispatchDriver OverviewClass MembersHierarchy Chart

See Also   COleException, COleDispatchException