ActiveX Control invokehelper

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.