Hi,
I have a program which is an app with QApplication. Can I just change the project file to make it a DLL (instead of EXE), and remove the main function and still keep my original QApplication?
Thanks.
Hi,
I have a program which is an app with QApplication. Can I just change the project file to make it a DLL (instead of EXE), and remove the main function and still keep my original QApplication?
Thanks.
Sure you can but you'll still need an executable linked to the shared library or your program won't launch...
Current Qt projects : QCodeEdit, RotiDeCode
Hi,
I plan to write a DLL which contains a QApplication with a lot of gui(s) (It used to be a EXE, now I want to make it a DLL). And my customer will write another Qt EXE which also contains a QApplication with their gui(s). This EXE then link against my DLL.
Is it possible?
Thanks
I don't think it's a good choice... Maybe it's better not to create a QApplication inside the dll and just use the one provided by the main binary? This would be the "usual" way to do it. Otherwise you'd have to implement those GUIs as a separate thread (you can't have two QApplication objects in the same thread, or even the same application -- you have to use QThread::exec instead).
You should read about extending Qt applcations with plugins . Maybe the concept will become more clear then... and maybe that's what you really want.
What if I need to create a dll which could be used from win api, mfc and Qt applications. In such a case I need QApplication inside dll for mfc/win api programs, but don't need for Qt-based apps. Is it possible to find from dll if application Qt-based or not ?
why would you need to mix Qt and MFC/WinAPI ??? Are you sure you're working on the best design??? Your approach seems an overkill and AFAIK the only way to check if a dll uses Qt is to doit on your own by creating an exported function/variable and looking for it in the exported symbols of the dll... And that is an suicide as well!
Current Qt projects : QCodeEdit, RotiDeCode
It's not my decision to mix Qt and mfc. I simply have to do it. Anyway the problem was solved. I've exported function "init()" which must be called before dll using.
Bookmarks