【发布时间】:2011-02-23 00:36:27
【问题描述】:
我需要创建一个导出函数并具有图形用户界面的 Windows DLL。 DLL 中的 GUI 的原因是 DLL 用作另一个 3rd 方应用程序的一种插件。目前我只能访问 AFAIK 不支持 MFC 的 Visual Studio Express,所以我正在寻找在 DLL 中创建 GUI 的替代方法。经过一些研究,我遇到了看起来很有希望的 Qt。而且似乎只使用 Qt Creator IDE 而不是 Visual Studio Express 可能更容易。
但是,如何在 Qt Creator 中创建 Windows DLL? (我猜是普通的 DLL,我不认为 COM 或托管 DLL 可以工作)
更新: 我得到了这个工作!跳了几圈之后,加了两个重要的键
#include <windows.h>
然后使用 Qt/MFC 迁移框架工具(目前正式在:http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtwinmigrate 编辑:我相信这是新链接:https://github.com/qtproject/qt-solutions/tree/master/qtwinmigrate)
我用这个例子让我开始:
http://doc.qt.nokia.com/solutions/4/qtwinmigrate/winmigrate-qt-dll-example.html
【问题讨论】:
-
哇,是的,你是对的,express 不支持 MFC 或 ATL - 我实际上不知道。下面是 Visual Studio C++ 版本的比较:msdn.microsoft.com/library/hs24szh9.aspx
-
@RobS 没有什么应该支持 MFC 废话 :)
标签: c++ qt dll qt4 qt-creator