8
votes

I need to create a windows DLL that exports functions and has a graphical user interface. The reason for the GUI in the DLL is that the DLL serves as a kind of plugin for another 3rd party application. Currently I only have access to Visual Studio Express which AFAIK doesn't support MFC so I'm looking for alternative ways to create a GUI in a DLL. After some research I came across Qt which seems promising. And it seems like it might be easier to just use the Qt Creator IDE rather than Visual Studio Express.

However, how do I create a windows DLL in Qt Creator? (I guess a regular DLL, I don't think a COM or managed DLL will work)

UPDATE: I got this working! After jumping through several hoops, two important keys were to add

 #include <windows.h>

And then to use the Qt/MFC Migration Framework tool (currently officially available at: http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtwinmigrate EDIT: I believe this is the new link: https://github.com/qtproject/qt-solutions/tree/master/qtwinmigrate)

I used this example to get me going:

http://doc.qt.nokia.com/solutions/4/qtwinmigrate/winmigrate-qt-dll-example.html

EDIT: I believe this is the new link http://htmlpreview.github.io/?https://github.com/qtproject/qt-solutions/blob/master/qtwinmigrate/doc/html/winmigrate-qt-dll-example.html

2
Wow, yes, you are right, express doesn't support MFC or ATL - I didn't know that actually. Here's a comparison of the Visual Studio C++ Editions: msdn.microsoft.com/library/hs24szh9.aspxRobS
@RobS Nothing should support MFC crap :)Piotr Dobrogost

2 Answers

11
votes

Add the folowing line to the .pro file: TEMPLATE = lib

That's just about all you'll have to do to have QtCreator make your 'app' into a dll.