• 12446阅读
  • 15回复

MFC中使用QT DLL ,求助 [复制链接]

上一主题 下一主题
离线maria179
 

只看楼主 正序阅读 楼主  发表于: 2008-12-22
— 本帖被 XChinux 执行加亮操作(2009-01-06) —
请问在mfc工程中怎么使用qt的dll呢
离线optphantom

只看该作者 15楼 发表于: 2008-12-23
我试过,只要qt的dll带了GUI,除了qt调用,其他不行;无GUI则都可以。
不过,据说用qtwinmigrate可以,要钱的

Qt/MFC Migration Framework v2.7

The Qt/MFC Migration Framework tool assists in the migration of
existing Win32 or MFC applications to the Qt toolkit.

The project provides a set of classes that allow using Qt and
MFC/Win32 windows in the same application. User interface elements
developed with Qt can be embedded into an existing MFC or Win32
based user interface, and existing custom controls developed with
MFC or Win32 can be integrated into Qt widgets.
离线浪漫天使
只看该作者 14楼 发表于: 2008-12-23
因为试过 所以才这么说的

这个基本不行,因为一般来说你的dll都有界面的,而qt的界面运行就需要一个qt的QApplication来进行qt的消息循环,除非你的qt的dll自己创建一个QT的QApplication,但是这个dll里面创建的QApplication会跟mfc的theApp 会有一些潜在的冲突。

当然这只是我一家之言,论坛很多高手,你问问问他们呗。
离线maria179

只看该作者 13楼 发表于: 2008-12-23
我不懂qt,只会mfc
你能帮我试试吗
离线浪漫天使
只看该作者 12楼 发表于: 2008-12-23
既然这样 你可以用qt弄个简单的带界面的dll,让mfc调一下看看是否能调出来,能调出来就好说了是吧。
离线maria179

只看该作者 11楼 发表于: 2008-12-23
1. yes. It's exactly the same way as calling the MFC dll. Include the qt headers needed, link with the import libraray (qt-xxx.lib), and when running the program make sure it can find the qt-xxx.dll. Enough docs at trolltech.com

2. not that easy, imho Qt's internals are quite messy. But again, exactly the same as with the MFC dll: fire up the debugger, make sure it can find the qt-xxx.pdb symbol file, and you can just jump into functions like you always do.

3. quite, there's a plugin (QVsIntegration if i remember) that takes care of creating custom build steps etc for all Qt files.
离线maria179

只看该作者 10楼 发表于: 2008-12-23
Hi Ppl,

I am working on a new windows software dovelopment and evaluating whether we should use QT or stick to MFC.
We already have a platform on MFC and the new tool would be integrated to the platform. It will talk a good deal to the platform.

It would be really helpful, if some one could help me out on the following issues :-

1. Can a QT dll be called from an MFC exe ? if yes, could someone please point me to the documentation for this..

2. How easy would it be to debug such a dll ?

3. Is QT well integrated with visual studio ?

Please clarify.

Thnx
Prateek
离线浪漫天使
只看该作者 9楼 发表于: 2008-12-23
链接打开 看不到帖子内容 你全部复制一下 大家都看一下把
离线maria179

只看该作者 8楼 发表于: 2008-12-23
离线maria179

只看该作者 7楼 发表于: 2008-12-23
这个项目里,用了这个库
库里有界面
我在mfc下想要调用它
有什么办法吗
离线浪漫天使
只看该作者 6楼 发表于: 2008-12-23
大概的看了一下,整个库是针对qt写的,就是说用这个库的程序是qt的程序,而不是mfc的程序,

要么你就是买个qt的商业版本,里面有整合的技术支持,

要么你就用qt写程序 用这个库就还平滑了

要么你就不要这个库,找一些类似这个的是支持mfc的 开源的库,似乎这个很难

体会到开源 与 商业的 区别了把。
离线浪漫天使
只看该作者 5楼 发表于: 2008-12-23
QGLViewer 库 里面没有界面么?
离线maria179

只看该作者 4楼 发表于: 2008-12-23
我不需要运行里面的qt界面
界面我已经用mfc写出来了
离线maria179

只看该作者 3楼 发表于: 2008-12-23
是这样的,我需要把一个qt项目移植到mfc上
但是这个qt项目运用了一个库QGLViewer
网上有开源代码
这个库不知道怎么移植
里面封装了很多函数
我不可能都在mfc下写出来啊
离线wvins
只看该作者 2楼 发表于: 2008-12-22
9494
离线浪漫天使
只看该作者 1楼 发表于: 2008-12-22
这个基本不行,因为一般来说你的dll都有界面的,而qt的界面运行就需要一个qt的QApplication来进行qt的消息循环,除非你的qt的dll自己创建一个QT的QApplication,但是这个dll里面创建的QApplication会跟mfc的theApp 会有一些潜在的冲突。

我觉得你既然是mfc的工程 没有必要用qt写dll啊

如果你的问题是 qt的程序怎么用mfc的dll 又是另外一个问题。
快速回复
限100 字节
 
上一个 下一个