I am working with the QtMFC Migration toolkit and I have a question about how to incorporate it into an existing MFC application.
The application I am working with is split into 3 projects: The GUI QT project which generates a .lib file. The GUI DLL project which links with the GUI QT lib and generates a .dll and a .lib file. Last there is the MFC Application project which links with the GUI DLL project and generates an executable.
MFC Application
(links with gui.lib and QtGui.lib)
|
V
GUI DLL
(generates gui.lib and
links with guiQt.lib and QtGui.lib)
|
V
GUI QT LIB
(generates guiQt.lib)
I am going to override the CWinApp::Run method in the MFC Application project to use QMfcApp::run which will create a QApplication object and process both MFC and Qt messages. Now that a QApplication object has been created in the MFC Application project, will the method QApplication::instance( ), if called within the GUI DLL project, return a valid pointer to that same QApplication object?
If not, is it safe for the MFC application project to call an exported method of the GUI DLL project and pass a valid QApplication pointer as a parameter? Am I going about this the wrong way? Is this a place to use the QMfcApp:luginInstance method instead?
Bookmarks