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. Qt/MFC Migration Framework - How to support reloading of DLL?
Forum Update on Monday, May 27th 2025

Qt/MFC Migration Framework - How to support reloading of DLL?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 5.1k 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.
  • O Offline
    O Offline
    overflowing
    wrote on 26 Feb 2011, 01:05 last edited by
    #1

    I'm using the Qt 4.7.1 and Qt/MFC Migration Framework. I'm building a DLL that has a Qt GUI and will be used as plugin in a MFC application.

    I'm following the directions at http://doc.qt.nokia.com/solutions/4/qtwinmigrate/winmigrate-walkthrough.html. I can load the app in the MFC application and my Qt gui is displayed. However, when I unload the DLL from within the MFC app and then try to reload the DLL I get an error about:

    ASSERT failure in QWidget: "Widgets must be created in the GUI thread."

    How can I make it so my DLL can be loaded and unloaded and reloaded without error?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MarkoSiroki
      wrote on 26 Feb 2011, 08:07 last edited by
      #2

      I think GUI must be created in main thread, reloaded GUI is not on main thread.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        overflowing
        wrote on 1 Mar 2011, 23:32 last edited by
        #3

        I believe you are correct. I think the MFC application kicks off a new thread each time the plugin is loaded (but does not unload the DLL). Therefore, the QApplication created when the DLL first starts up is still around, but the reloaded plugin is executing on a new thread and can't access it.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kaylx
          wrote on 26 Apr 2011, 10:37 last edited by
          #4

          Did you get anywhere with this? I've just started looking at the Qt/MFC Migration Framework and have the same issue.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            overflowing
            wrote on 27 Apr 2011, 18:59 last edited by
            #5

            I think I did eventually overcome this particular hurdle only to encounter several others. I think I did this by making sure to call qApp->quit(); and delete qApp when my plugin was unloaded.

            However for my case, I felt like I was climbing uphill trying to use Qt and there is very little information on Qt/MFC on the net. In the end I bit the bullet and decided to develop in MFC which I don't think is that much worse than Qt.

            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