8

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
  • 1
    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.aspx
    – RobS
    Feb 23, 2011 at 4:59
  • 2
    @RobS Nothing should support MFC crap :) Feb 23, 2011 at 19:41

2 Answers 2

11

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.

-1

check qt plugins http://cartan.cas.suffolk.edu/qtdocs/plugins-howto.html

1
  • I'm not trying to build a qt plugin
    – User
    Feb 23, 2011 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.