Activex control programming in Qt environment ------- 1, activex ------- 1

Source: Internet
Author: User

Activex control programming in Qt environment ------- 1, activex ------- 1

I first came into contact with this activeX control. After referring to a lot of tutorials on the internet, I finally took more than three hours to get a preliminary understanding and compile a small demo. Now I want to share it with you, so I hope you can avoid detours. The procedure is as follows:

1> Create a demo like a normal project, add the header file <QAxWidget> required by the activeX control in the main method, and. add the QT + = axcontainer code to the pro file, step 1.

Remember: the header file required by the control can be found in the include directory under the qt installation directory. When adding the file, check whether the path is correct.

2> Create a QAxWidget object in the man method, use the setcontral method to instantiate the object, and then use dynamicCall to load the required resources (for my temporary understanding)

 QAxWidget * flash = new QAxWidget (0, 0 );

Flash-> resize (50, 80 );

Flash-> setControl ("{d27cdb6e-ae6d-11cf-96b8-444553540000}"); // registration information is obtained by touching a programming tool, I have not found the most suitable tool to obtain ClassID

Flash-> dynamicCall ("LoadMovie (long, string)", 0, "C:/Users/SHRD/Documents/QTMapXTest/flash4770.swf"); 3

Flash-> show ();

3> clickFlashReplace the file with your own file path name.

Run the following command:

 

Related Article

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.