16,235
社区成员
发帖
与我相关
我的任务
分享
typedef int (*cxy_open_port)(int);
typedef int (*cxy_close_port)();
typedef int (*cxy_chongzhi)(int,int);
QLibrary myLib("cxy_IC5557.dll");
cxy_open_port pcxy_open_port = (cxy_open_port)myLib.resolve("cxy_open_port");
cxy_close_port pcxy_close_port = (cxy_close_port)myLib.resolve("cxy_close_port");
cxy_chongzhi pcxy_chongzhi = (cxy_chongzhi)myLib.resolve("cxy_chongzhi");
pcxy_open_port(ui->txtCom->value());
int ret = pcxy_chongzhi(huaMengOne.biaohao,5000);
ui->edtRecv->append("写卡结果:" + QString::number(ret));
pcxy_close_port();
void MainWindow::on_btnOpen_clicked()
{
typedef int (*IDCarderCreate)(int);
typedef int (*IDCarderBeep)();
typedef int (*IDCarderDestory)();
HINSTANCE hModule = ::LoadLibraryA("JSMT_Card.dll");
IDCarderCreate pIDCarderCreate = (IDCarderCreate)::GetProcAddress(hModule,"IDCarderCreate");
IDCarderBeep pIDCarderBeep = (IDCarderBeep)::GetProcAddress(hModule,"IDCarderBeep");
IDCarderDestory pIDCarderDestory = (IDCarderDestory)::GetProcAddress(hModule,"IDCarderDestory");
pIDCarderCreate(ui->txtCom->value());
pIDCarderBeep();
pIDCarderDestory();
FreeLibrary(hModule);
}