首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

Qt中动态调用dll后,怎么释放dll

2012-03-11 
Qt中动态调用dll后,如何释放dll?QLibrary mylib(aaa.dll)if (mylib.load()){//创建一个dll对象,将其放

Qt中动态调用dll后,如何释放dll?
QLibrary mylib("aaa.dll"); 
if (mylib.load())  
{  
  //创建一个dll对象,将其放入一个窗口中
}  
 
当我关闭窗口的时候,如何释放dll呢?
ps:当我load两次dll的时候,关闭窗口时,就会报错:“Unhandled exception at 0x02938c13 in XXX.exe: 0xC0000005: Access violation reading location 0xfeeefefa.”
求高手,求解释,求解决。。。。

[解决办法]

bool QLibrary::unload ()
Unloads the library and returns true if the library could be unloaded; otherwise returns false.
This happens automatically on application termination, so you shouldn't normally need to call this function.
If other instances of QLibrary are using the same library, the call will fail, and unloading will only happen when every instance has called unload().
Note that on Mac OS X 10.3 (Panther), dynamic libraries cannot be unloaded.

热点排行