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: