Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] MFC application using DLL created by Qt
Forum Update on Monday, May 27th 2025

[Solved] MFC application using DLL created by Qt

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 9.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jackbauer_777
    wrote on 8 Oct 2010, 05:05 last edited by
    #1

    Now I want to use some Qt widgets at my own MFC app.
    I am prohibited to change my Development tool(VS8) and use ActiveX control(QAxObject),
    so I want to use Qt widgets as Library( i.e *.dll).

    Please teach me wheather is it possible?

    If it is possible, I want to do the same thing at Solaris application.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dibben
      wrote on 8 Oct 2010, 08:11 last edited by
      #2

      You want to have a look at the Qt-MFC migration framework in QtSolutions
      "http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/":http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/

      This has information on how to use Qt widgets in a Win32 application.

      The main problem is the event loop - the MFC application handles the events so Qt widgets won't get them. AFAIK the Qt-MFC framework provides the classes for synchronizing the event loops so that your Qt widgets will get Qt events.

      [edit: fixed link]

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jackbauer_777
        wrote on 10 Oct 2010, 17:25 last edited by
        #3

        Thank Mr.David for sending me good information.

        QWinWidget is interesting!
        But I met the trouble using QWinWidget.

        About qtwinmigrate-2.8_1-opensource, I have two questions.

        At install.txt "3. Building the component and examples "
        g++ is required. But g++ is not found.
        My setup(vista) seems to be wrong?

        From QtCreator, I open buildlib.pro and build library.

        By VC++2008 Express, I add two header
        <QWinWidget>,<QMessageBox> at my MFC app.

        At BOOL InitInstance(HINSTANCE hInstance, int nCmdShow),
        I write simple the following simple code:
        QWinWidget qwin(hWnd);
        qwin.center();
        QMessageBox::information(&qwin, "Caption", "Information Text");

        int argc = 0;
        QApplication a( argc, 0 );

        return a.exec();

        But I met the following error
        error LNK2019: "__declspec(dllimport) public: virtual __thiscall QWinWidget::~QWinWidget(void)"

        I apologize my lack of skills, but if it is possible, could you advise?

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on 11 Oct 2010, 06:23 last edited by
          #4

          hi david, can you convert the url text to a link

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jackbauer_777
            wrote on 18 Oct 2010, 15:55 last edited by
            #5

            When I compiled Qt by VC2008express, I didn’t meet above trouble.

            So This problem was solved for me^^;
            .

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved