Qt 编程 DLL和DLL的3中常见调用方法

上传者: niuxuexin | 上传时间: 2021-09-27 17:10:37 | 文件大小: 2.01MB | 文件类型: ZIP
DLL_CALL1: 调用dll里的全局函数,使用QLibrary,它封装了loadlibrary和getprocaddress,等 freelibrary 要求: 需要知道dll里函数的原型,来写函数指针。 dll放到一个指定的目录下不一定非exe旁边。 DLL_CALL2: 调用dll里类的成员函数,使用com的方法(也是QLibrary),gettestdll返回接口的指针。 要求: 包含dll的头文件这样(1、获得对象的函数指针2、接口的原型) dll放到一个指定的目录下不一定非exe旁边。 DLL_CALL2_3: 调用插件形式dll的方法,使用QPluginLoader。 要求:包含头文件,(插件的接口的原型需要知道,得到接口的指针调用函数)。 dll放到一个指定的目录下不一定非exe旁边。 DLL_CALL3: 静态连接的形式,在Qt的项目上右键-》添加库(内部库可能就是本工程内的,外部的就是外面 的??)-》把lib选上ok。 要求: dll头文件,有了头文件后,可以直接使用dll中的类和dll中的全局函数。但是执行时dll得放到 exe旁边。 dll必须放到系统目录或exe旁边。

文件下载

资源详情

[{"title":"( 89 个子文件 2.01MB ) Qt 编程 DLL和DLL的3中常见调用方法","children":[{"title":"DLL_CALL2","children":[{"title":"Makefile <span style='color:#111;'> 6.70KB </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 412.00KB </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 5.33KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"TEST_DLL.dll <span style='color:#111;'> 27.50KB </span>","children":null,"spread":false},{"title":"DLL_CALL2.exe <span style='color:#111;'> 24.00KB </span>","children":null,"spread":false},{"title":"DLL_CALL2.intermediate.manifest <span style='color:#111;'> 878B </span>","children":null,"spread":false},{"title":"DLL_CALL2.ilk <span style='color:#111;'> 278.54KB </span>","children":null,"spread":false},{"title":"DLL_CALL2.pdb <span style='color:#111;'> 579.00KB </span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'> 39.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"DLL_CALL2.pro <span style='color:#111;'> 311B </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 730B </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 5.33KB </span>","children":null,"spread":false}],"spread":true},{"title":"PLUGIN_DLL","children":[{"title":"Makefile <span style='color:#111;'> 6.79KB </span>","children":null,"spread":false},{"title":"PluginInterface.h <span style='color:#111;'> 352B </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 684.00KB </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 6.10KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"moc_PluginInstance.obj <span style='color:#111;'> 33.32KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.ilk <span style='color:#111;'> 294.92KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.lib <span style='color:#111;'> 2.04KB </span>","children":null,"spread":false},{"title":"PluginInstance.obj <span style='color:#111;'> 72.92KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.pdb <span style='color:#111;'> 859.00KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.exp <span style='color:#111;'> 810B </span>","children":null,"spread":false},{"title":"moc_PluginInstance.cpp <span style='color:#111;'> 2.70KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.intermediate.manifest <span style='color:#111;'> 621B </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.dll <span style='color:#111;'> 36.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"PluginInstance.cpp <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.pro <span style='color:#111;'> 723B </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 6.13KB </span>","children":null,"spread":false},{"title":"PluginInstance.h <span style='color:#111;'> 382B </span>","children":null,"spread":false}],"spread":true},{"title":"DLL_CALL1","children":[{"title":"Makefile <span style='color:#111;'> 6.70KB </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 412.00KB </span>","children":null,"spread":false},{"title":"DLL_CALL1.pro <span style='color:#111;'> 311B </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 5.28KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"DLL_CALL1.ilk <span style='color:#111;'> 283.54KB </span>","children":null,"spread":false},{"title":"TEST_DLL.dll <span style='color:#111;'> 27.50KB </span>","children":null,"spread":false},{"title":"DLL_CALL1.exe <span style='color:#111;'> 24.50KB </span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'> 39.07KB </span>","children":null,"spread":false},{"title":"DLL_CALL1.intermediate.manifest <span style='color:#111;'> 878B </span>","children":null,"spread":false},{"title":"DLL_CALL1.pdb <span style='color:#111;'> 579.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"main.cpp <span style='color:#111;'> 571B </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 5.27KB </span>","children":null,"spread":false},{"title":"DLL_CALL1.pro.user <span style='color:#111;'> 18.46KB </span>","children":null,"spread":false}],"spread":true},{"title":"解释.txt <span style='color:#111;'> 840B </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 6.65KB </span>","children":null,"spread":false},{"title":"TEST_DLL","children":[{"title":"TEST_DLL.pro.user <span style='color:#111;'> 18.43KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 6.77KB </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 196.00KB </span>","children":null,"spread":false},{"title":"test_dll.cpp <span style='color:#111;'> 225B </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 5.26KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"TEST_DLL.dll <span style='color:#111;'> 27.50KB </span>","children":null,"spread":false},{"title":"TEST_DLL.pdb <span style='color:#111;'> 347.00KB </span>","children":null,"spread":false},{"title":"TEST_DLL.intermediate.manifest <span style='color:#111;'> 621B </span>","children":null,"spread":false},{"title":"TEST_DLL.exp <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"test_dll.obj <span style='color:#111;'> 37.26KB </span>","children":null,"spread":false},{"title":"TEST_DLL.ilk <span style='color:#111;'> 286.15KB </span>","children":null,"spread":false},{"title":"TEST_DLL.lib <span style='color:#111;'> 2.97KB </span>","children":null,"spread":false}],"spread":true},{"title":"TEST_DLL.pro <span style='color:#111;'> 694B </span>","children":null,"spread":false},{"title":"TEST_DLL_global.h <span style='color:#111;'> 258B </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 5.26KB </span>","children":null,"spread":false},{"title":"test_dll.h <span style='color:#111;'> 384B </span>","children":null,"spread":false}],"spread":false},{"title":"DLL_CALLS.pro.user <span style='color:#111;'> 43.00KB </span>","children":null,"spread":false},{"title":"DLL_CALL2_2","children":[{"title":"DLL_CALL2_2.pro <span style='color:#111;'> 313B </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 143B </span>","children":null,"spread":false}],"spread":true},{"title":"DLL_CALLS.pro <span style='color:#111;'> 149B </span>","children":null,"spread":false},{"title":"DLL_CALL2_3","children":[{"title":"Makefile <span style='color:#111;'> 6.72KB </span>","children":null,"spread":false},{"title":"DLL_CALL2_3.pro <span style='color:#111;'> 313B </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 412.00KB </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 5.36KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"DLL_CALL2_3.exe <span style='color:#111;'> 26.00KB </span>","children":null,"spread":false},{"title":"DLL_CALL2_3.intermediate.manifest <span style='color:#111;'> 878B </span>","children":null,"spread":false},{"title":"DLL_CALL2_3.pdb <span style='color:#111;'> 603.00KB </span>","children":null,"spread":false},{"title":"DLL_CALL2_3.ilk <span style='color:#111;'> 315.80KB </span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'> 42.43KB </span>","children":null,"spread":false}],"spread":false},{"title":"main.cpp <span style='color:#111;'> 691B </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 5.35KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.dll <span style='color:#111;'> 36.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"DLL_CALL3","children":[{"title":"DLL_CALL3.pro <span style='color:#111;'> 565B </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 6.70KB </span>","children":null,"spread":false},{"title":"vc90.pdb <span style='color:#111;'> 420.00KB </span>","children":null,"spread":false},{"title":"release","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 5.47KB </span>","children":null,"spread":false},{"title":"debug","children":[{"title":"DLL_CALL3.exe <span style='color:#111;'> 23.50KB </span>","children":null,"spread":false},{"title":"DLL_CALL3.ilk <span style='color:#111;'> 280.76KB </span>","children":null,"spread":false},{"title":"DLL_CALL3.intermediate.manifest <span style='color:#111;'> 878B </span>","children":null,"spread":false},{"title":"TEST_DLL.dll <span style='color:#111;'> 27.50KB </span>","children":null,"spread":false},{"title":"DLL_CALL3.pdb <span style='color:#111;'> 579.00KB </span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'> 37.32KB </span>","children":null,"spread":false},{"title":"PLUGIN_DLL.dll <span style='color:#111;'> 36.00KB </span>","children":null,"spread":false}],"spread":false},{"title":"main.cpp <span style='color:#111;'> 394B </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 5.42KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • mjh1992423 :
    不完整,QT5我使用向导添加的
    2014-11-07
  • li1zhong :
    不完整,QT5我使用向导添加的
    2014-06-07
  • fungyun :
    我怎么全部都load失败啊,悲剧。
    2013-02-22
  • lglyjlylglyjly :
    非常有用,太感谢了。
    2012-12-21

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明