吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 408|回复: 0
收起左侧

[讨论] qt调用大漠

[复制链接]
lanpo5566 发表于 2023-11-14 18:44
网上找的qt调用大漠
#include "widget.h"
#include <QApplication>
#include<QDebug>
#include<windows.h>
#include<QDir>
#include<QLibrary>
#include "dm.h"
int Register()
{
    CoInitializeEx(nullptr,0);//初始化com
    QString path = QDir::currentPath();//获得当前地址
    path.append("/dm.dll"); //现在path代表dm.dll的绝对地址
    qDebug()<<path;
    typedef  int(__stdcall*pfun)(char*,int);//定义一个函数指针
    pfun reg = (pfun) QLibrary::resolve("DmReg.dll","SetDllPathA");//链接DmReg.dll中的 SetDllPathA

    return reg((char*)path.toStdString().data(),1);//调用SetDllPathA函数
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    w.show();
    Register();
    dm::Idmsoft dm;//创建大漠对象   
    dm.setControl("dm.dmsoft");//初始化
    qDebug()<<dm.Ver();
    return a.exec();
}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-23 14:21

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表