Qt generated ActiveX control calls (b) in MFC

  1. Build the MFC dialog procedures, pay attention to solve the program version and platform version of the same generation ActiveX control, here are x32. (At X64 in question)
  2. Add Class, select the MFC Class ActiveX control
    Here Insert Picture Description
  3. Select Add Class wizard dll QtActice controls, and produced two CQtActiveWidget CQtActiveWidgetEvents, wherein CQtActiveWidget contains Active Interface Controls
void slt_setLineText(QString str);void slt_setLineText(QString str);
QString slt_getLineText();
void slt_clickedButton(bool clicked);

Here Insert Picture Description
6. Click Finish QtActive control into the MFC classes. Compile the project, in CQtActiveWidgetEvents.h error, suggested that the lack QPoint header files.
Because MFC class generated will contain some kind of Qt, such as QPoint, then you need to add header files in the directory Qt MFC project. Add the directory path according to their own installation of Qt. Generated MFC class will include some type of Qt, such as QPoint, then you need to add header files in the directory Qt MFC project. Add the directory path according to their own installation of Qt.
Here Insert Picture DescriptionAdd #include in CQtActiveWidgetEvents.h in "./QtCore/qpoint.h" program success.
7. In the dialog editing interface right select Insert ActiveX control, the generated selection control. Select control, add variables.
8. The variable type CQtActiveWidget. QtActive controls can be operated by calling interface.

Guess you like

Origin blog.csdn.net/u011370855/article/details/86082649