When you call related methods in ActiveX control, you need to import the controlProgramIn the project, a pseudo call class about the control call is generated.
Methods are located by calling the dwdispid value in invokehelper! Therefore,The invokehelper call can be understood as location
A Method Related to ActiveX Controls
!
Invokehelper: An encapsulation method used to call the idispatch interface method of Ole.
Cwnd: invokehelper
Call this member function to invoke the ActiveX control method or property specifiedDwdispid
, In the context specifiedWflags
.
Void afx_cdecl invokehelper (
Dispid dwdispid,
Word wflags,
Vartype vtret,
Void * pvret,
Const byte * pbparaminfo,
...
);
Parameters
-
-
Dwdispid
-
-
Identifies the method or property to be invoked.
-
-
Wflags
-
-
Flags describing the context of the call
Idispatch: invoke
. For possible
Wflags
Values, see idispatch: invoke
In
Platform SDK
.
-
-
Vtret
-
-
Specifies the type of the return value. for possible values, see the remarks section for coledispatchdriver: invokehelper
.
-
-
Pvret
-
-
Address of the variable that will receive the property value or return value. It must match the type specified
Vtret
.
-
-
Pbparaminfo
-
-
Pointer to a null-terminated string of bytes specifying the types of the parameters following
Pbparaminfo
. For possible values, see the remarks section
Coledispatchdriver: invokehelper
.
-
-
...
-
-
Variable list of parameters, of types specified in
Pbparaminfo
.
Remarks
ThePbparaminfo
Parameter specifies the types of the parameters passed to the method or
Property. The variable list of arguments is represented...
In the syntax declaration.
This function converts the parametersVariantarg
Values, then invokesIdispatch: invoke
Method on the ActiveX control. If the callIdispatch: invoke
Fails, this function will throw an exception. IfScode
(Status Code) returnedIdispatch: invoke
IsDisp_e_exception
, This function throws a coleexception
Object, otherwise it throws a coledispatchexception
.
Note
This function shoshould be called only onCwnd
Object that represents an ActiveX control.
For
More information about using this member function with ActiveX Control
Containers, see the article ActiveX Control containers: Programming
ActiveX controls in an ActiveX control container.