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. QtWinMigrate in an MFC DLL?
Forum Updated to NodeBB v4.3 + New Features

QtWinMigrate in an MFC DLL?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 183 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Dan203
    wrote on last edited by
    #1

    I'm working on porting a massive MFC app over to Qt. I'm using QtWinMigrate so I can port portions of the code one at a time. I've run into an issue that I can't figure out. I have many MFC DLLs that contain UI elements. These are full blown MFC DLLs with their own CWinApp and do not have a DllMain function. If I try to include QtWinMigrate into the CWinApp like I did in the main window I get an error saying that only one application object is allowed. But if I just try to use QWinWidget inside the DLL without it then it asserts somewhere deep inside the MFC source code.

    I can export the Qt classes individually and use them in the main window just fine, but in some cases I have nested dialogs where an MFC dialog inside the DLL needs to call another dialog inside the DLL. That's when I run into the issue. I need the MFC dialogs inside the DLL to be able to call the Qt dialogs inside the DLL. This is the code I'm using to call the dialog...

    QWinWidget win(this);
    win.showCentered();
    
    QtDialog dlg(&win);
    dlg.exec();
    

    I've also tried using AfxGetMainWnd() in place of "this" in the QWinWidget constructor and it does the same thing.

    Does anyone know how to make this work?

    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