• 9093阅读
  • 2回复

A bug to qtwinmigrate 2.8 (Cannot FreeLibrary my dll when using qtwinmigrate) [复制链接]

上一主题 下一主题
离线hcaihao
 

只看楼主 倒序阅读 楼主  发表于: 2009-07-03
Take "qtwinmigrate-2.8-opensource->examples->mfc->step 1 or step2" for example:

HMODULE mod = LoadLibrary( "qtdialog.dll" );
if ( mod ) {
typedef BOOL(*pShowDialog)(HWND parent);
pShowDialog showDialog = (pShowDialog)GetProcAddress( mod, "showDialog" );
if ( showDialog )
showDialog( theApp.m_pMainWnd->m_hWnd );
FreeLibrary( mod );

After the code above, the qtdialog.dll still exist in A.exe. I think it’s a bug.



上面是我发在国外的帖子,直接转过来了。简单来说,我发现用到了qtwinmigrate的DLL,一旦被载入,就无法释放了。谁能帮忙一下,整个互联网我都翻遍了。
离线wolke
只看该作者 1楼 发表于: 2009-09-28
请问楼主,qtwinmigrate怎么用起来的?
我下载的是qtwinmigrate-2.8-opensource
在qt-creator中编译,报错:

Running build steps for project qtwinmigrate...
Starting: D:/Qt/2009.02/qt/bin/qmake.exe D:/Qt/qtwinmigrate-2.8-opensource/qtwinmigrate.pro -spec win32-g++ -r CONFIG+=release
Reading D:/Qt/qtwinmigrate-2.8-opensource/examples/examples.pro
Reading D:/Qt/qtwinmigrate-2.8-opensource/examples/winhost/winhost.pro
Reading D:/Qt/qtwinmigrate-2.8-opensource/examples/winwidget/winwidget.pro
Reading D:/Qt/qtwinmigrate-2.8-opensource/examples/qtdll/qtdll.pro
Exited with code 0.
Starting: D:/Qt/2009.02/mingw/bin/mingw32-make.exe -w
D:\Qt\2009.02\mingw\bin\mingw32-make.exe: Entering directory `D:/Qt/qtwinmigrate-2.8-opensource'
cd examples/ && D:/Qt/2009.02/mingw/bin/mingw32-make.exe -f Makefile
d:\Qt\2009.02\mingw\bin\mingw32-make.exe[1]: Entering directory `d:/Qt/qtwinmigrate-2.8-opensource/examples'
cd winhost/ && d:/Qt/2009.02/mingw/bin/mingw32-make.exe -f Makefile
d:\Qt\2009.02\mingw\bin\mingw32-make.exe[2]: Entering directory `d:/Qt/qtwinmigrate-2.8-opensource/examples/winhost'
d:/Qt/2009.02/mingw/bin/mingw32-make.exe -f Makefile.Release
mingw32-make.exe[3]: Entering directory `d:/Qt/qtwinmigrate-2.8-opensource/examples/winhost'
D:/Qt/2009.02/qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../2009.02/qt/include/QtCore' -I'../../../2009.02/qt/include/QtGui' -I'../../../2009.02/qt/include' -I'../../src' -I'../../../2009.02/qt/include/ActiveQt' -I'release' -I'.' -I'.' -I'../../../2009.02/qt/mkspecs/win32-g++' -D__GNUC__ -DWIN32 main.cpp -o release/main.moc
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../2009.02/qt/include/QtCore' -I'../../../2009.02/qt/include/QtGui' -I'../../../2009.02/qt/include' -I'../../src' -I'../../../2009.02/qt/include/ActiveQt' -I'release' -I'.' -I'.' -I'../../../2009.02/qt/mkspecs/win32-g++' -o release/main.o main.cpp
main.cpp: In member function `virtual HWND__* HostWindow::createWindow(HWND__*, HINSTANCE__*)':
main.cpp:84: warning: cast to pointer from integer of different size

g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../2009.02/qt/include/QtCore' -I'../../../2009.02/qt/include/QtGui' -I'../../../2009.02/qt/include' -I'../../src' -I'../../../2009.02/qt/include/ActiveQt' -I'release' -I'.' -I'.' -I'../../../2009.02/qt/mkspecs/win32-g++' -o release/qwinwidget.o ../../src/qwinwidget.cpp
In file included from ../../src/qwinwidget.cpp:57:
../../src/qmfcapp.h:77: error: base `QApplication' with only non-default constructor in class without a constructor

mingw32-make.exe[3]: Leaving directory `d:/Qt/qtwinmigrate-2.8-opensource/examples/winhost'
d:\Qt\2009.02\mingw\bin\mingw32-make.exe[2]: Leaving directory `d:/Qt/qtwinmigrate-2.8-opensource/examples/winhost'
mingw32-make.exe[3]: *** [release/qwinwidget.o] Error 1
d:\Qt\2009.02\mingw\bin\mingw32-make.exe[2]: *** [release] Error 2

d:\Qt\2009.02\mingw\bin\mingw32-make.exe[1]: Leaving directory `d:/Qt/qtwinmigrate-2.8-opensource/examples'
d:\Qt\2009.02\mingw\bin\mingw32-make.exe[1]: *** [sub-winhost-make_default] Error 2
D:\Qt\2009.02\mingw\bin\mingw32-make.exe: Leaving directory `D:/Qt/qtwinmigrate-2.8-opensource'
D:\Qt\2009.02\mingw\bin\mingw32-make.exe: *** [sub-examples-make_default-ordered] Error 2
Exited with code 2.
Error while building project qtwinmigrate
When executing build step 'Make'
离线normallife
只看该作者 2楼 发表于: 2010-03-26
我也遇到了这个问题。不过可以给你看看这个:
http://blog.csdn.net/tingsking18/archive/2009/12/28/5091580.aspx
应该知道Qt的一个bug,不知道Qt现在修复了没
快速回复
限100 字节
 
上一个 下一个