QT 插件调用
2015-01-22 15:53
190 查看
#ifndef DMREGISTER
#define DMREGISTER
#include <Windows.h>
#include <QLibrary>
#include "atlbase.h"
//#include "dm.tlh"
struct Idmsoft;
Idmsoft* DmReg(const char* file);
#endif // DMREGISTER
#include "DmReg.h"
#include "dm.tlh"
//#include "atlcom.h"
//#import "D:\\3.1233\\dm.dll" no_namespace
typedef HRESULT (__stdcall *Func) (REFCLSID,REFIID,LPVOID*);
Idmsoft *DmReg(const char* file)
{
//CoInitialize(0);
HRESULT hr;
Func GetClass=nullptr;
GetClass=(Func)QLibrary::resolve(file,"DllGetClassObject");
if(!GetClass)return nullptr;
IClassFactory* pFactory=nullptr;
hr=GetClass(__uuidof(dmsoft),IID_IClassFactory,(LPVOID*)&pFactory);
if(FAILED(hr))return nullptr;
Idmsoft* idmsoft=nullptr;
hr=pFactory->CreateInstance(NULL,__uuidof(Idmsoft),(LPVOID*)&idmsoft);
pFactory->Release();
if(!idmsoft)return nullptr;
return idmsoft;
}
相关文章推荐
- QT实现浏览器插件 调用及回调 (二)
- Qt一步一步实现插件调用(附源码)
- Qt插件的析构函数不被调用(QTBUG17458)
- QT 商业版调用activex插件
- qt 编写插件 很好的解释了 WorkStation.exe 和trade.dll 之间如何调用
- Qt使用插件的形式调用DLL
- Qt之一步一步实现插件调用
- QT实现浏览器插件 调用及回调 (三)
- Qt 调用动态库 插件
- 如何在 静态编译的QT 5.5.1 中 使用数据库插件连接 ODBC(调用静态插件)
- C++ Qt 调用动态库 插件
- Qt一步一步实现插件调用(附源码)
- QT实现浏览器插件 调用及回调 (一)
- Qt一步一步实现插件调用(附源码)、Qt一步一步实现插件通信(附源码)
- Qt一步一步实现插件调用(附源码)
- chrome默认浏览器 外部调用 及 我常用的插件
- QT中调用外部程序的方法
- QT visual stuido 集成插件不能打开ui文件的原因
- QT-WebKit flash 插件问题
- Linux 下集成 Qt 插件至 Eclipse 全过程