找回密码
 加入
搜索
查看: 5652|回复: 16

[AU3基础] 请教一个dllcall的写法?[已解决]

 火.. [复制链接]
发表于 2017-2-21 17:15:04 | 显示全部楼层 |阅读模式
本帖最后由 仙乃日 于 2017-2-24 16:31 编辑

C++中的 unsigned char* 类型数据转换成AU3要写成什么?
int ReadIDCardComm(
int iPort,
unsigned char *ucName,
int &iNamelen,
unsigned char *ucSex,
int &iSexLen,
unsigned char *ucIDNo,
int &iIDNoLen,
unsigned char *ucNation,
int &iNationLen,
unsigned char *ucBirthday,
int &iBirthdayLen,
unsigned char *ucAddress,
int &iAddressLen,
4
unsigned char *ucGrantDept,
int &iGrantDeptLen,
unsigned char *ucUserLifeBegin,
int &iUserLifeBeginLen,
unsigned char *ucUserLifeEnd,
int &iUserLifeEndLen,
unsigned char *errMsg,
int &iErrMsgLen,
int nTimeOut);
参数说明:
【in】 int iPort, COM 口 是 1-9 USB 口是 1001-1016
【out】 unsigned char *ucName, //姓名
【out】 int &iNamelen,
【out】 unsigned char *ucSex, //性别
【out】 int &iSexLen,
【out】 unsigned char *ucIDNo, //身份证号
【out】 int &iIDNoLen,
【out】 unsigned char *ucNation, //民族
【out】 int &iNationLen,
【out】 unsigned char *ucBirthday, //生日
【out】 int &iBirthdayLen,
【out】 unsigned char *ucAddress, //地址
【out】 int &iAddressLen,
【out】 unsigned char *ucGrantDept, //签发机关
【out】 int &iGrantDeptLen,
【out】 unsigned char *ucUserLifeBegin, //有效开始日期
【out】 int &iUserLifeBeginLen,
【out】 unsigned char *ucUserLifeEnd, //有效结尾日期
【out】 int &iUserLifeEndLen,
【out】 unsigned char *errMsg, //错误信息
【out】 int &iErrMsgLen,
【in】 int nTimeOut //超时时间
* 返回值 0 成功 -1 失败 -2 超时 -3 取消
#include <array.au3>
Local $t_name = DllStructCreate("char szText[1024]")
If @error Then MsgBox(0,0,@error)
Local $p_name = DllStructGetPtr($t_name)
Local $Namelen = 0
Local $t_sex = DllStructCreate("char szText[1024]")
Local $p_sex = DllStructGetPtr($t_sex)
Local $SexLen = 0
Local $t_IDNo = DllStructCreate("char szText[1024]")
Local $p_IDNo = DllStructGetPtr($t_IDNo)
Local $IDNoLen = 0
Local $t_Nation = DllStructCreate("char szText[1024]")
Local $p_Nation = DllStructGetPtr($t_Nation)
Local $NationLen = 0
Local $t_Birthday = DllStructCreate("char szText[1024]")
Local $p_Birthday = DllStructGetPtr($t_Birthday)
Local $BirthdayLen = 0
Local $t_Address = DllStructCreate("char szText[1024]")
Local $p_Address = DllStructGetPtr($t_Address)
Local $AddressLen = 0
Local $t_GrantDept = DllStructCreate("char szText[1024]")
Local $p_GrantDept = DllStructGetPtr($t_GrantDept)
Local $GrantDeptLen = 0
Local $t_UserLifeBegin = DllStructCreate("char szText[1024]")
Local $p_UserLifeBegin = DllStructGetPtr($t_UserLifeBegin)
Local $UserLifeBeginLen = 0
Local $t_UserLifeEnd = DllStructCreate("char szText[1024]")
Local $p_UserLifeEnd = DllStructGetPtr($t_UserLifeEnd)
Local $UserLifeEndLenn = 0
Local $t_errMsg = DllStructCreate("char szText[1024]")
Local $p_errMsg = DllStructGetPtr($t_errMsg)
Local $errMsgLenn = 0

$aDllCallReturn = DllCall("IdReaderApiComm.dll", _
                "int", "ReadIDCardComm", _
                "int", 1001, _
                "ptr", $p_name, "int", $Namelen, _
                "ptr", $p_sex, "int", $SexLen, _
                "ptr", $p_IDNo, "int", $IDNoLen, _
                "ptr", $p_Nation, "int", $NationLen, _
                "ptr", $p_Birthday, "int", $BirthdayLen, _
                "ptr", $p_Address, "int", $AddressLen, _
                "ptr", $p_GrantDept, "int", $GrantDeptLen, _
                "ptr", $p_UserLifeBegin, "int", $UserLifeBeginLen, _
                "ptr", $p_UserLifeEnd, "int", $UserLifeEndLenn, _
                "ptr", $p_errMsg, "int", $errMsgLenn, _
                "int", 10000)
Local $name = DllStructGetData($t_IDNo, "szText")
MsgBox(0,$name,$aDllCallReturn[0])
_ArrayDisplay($aDllCallReturn)
以下是C++的源码
CStringAUsignedCharToCStringA(const unsigned char *buf,int iLen)
{
int iFixLen=iLen/2*2;
wstring wT;
int iT;
5
for (int i=0;i<iFixLen;i=i+2)
{
iT=buf[i]*256+buf[i+1];
wT+=(wchar_t)iT;
}
CStringAstr(wT.c_str());
return str;
}
void CYLzIdReaderDemoDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
int iPort=3;
int iTimeout=10000;
char errMsg[1024];
memset(errMsg,'\0',sizeof(errMsg));
unsigned char ucName[256];
memset(ucName,'\0',sizeof(ucName));
int iNamelen=0;
unsigned char ucSex[256];
memset(ucSex,'\0',sizeof(ucSex));
int iSexLen=0;
unsigned char ucIDNo[256];
memset(ucIDNo,'\0',sizeof(ucIDNo));
int iIDNoLen=0;
unsigned char ucNation[256];
memset(ucNation,'\0',sizeof(ucNation));
int iNationLen=0;
unsigned char ucBirthday[256];
memset(ucBirthday,'\0',sizeof(ucBirthday));
int iBirthdayLen=0;
unsigned char ucAddress[256];
memset(ucAddress,'\0',sizeof(ucAddress));
int iAddressLen=0;
unsigned char ucGrantDept[256];
memset(ucGrantDept,'\0',sizeof(ucGrantDept));
int iGrantDeptLen=0;
unsigned char ucUserLifeBegin[256];
memset(ucUserLifeBegin,'\0',sizeof(ucUserLifeBegin));
int iUserLifeBeginLen=0;
unsigned char ucUserLifeEnd[256];
6
memset(ucUserLifeEnd,'\0',sizeof(ucUserLifeEnd));
int iUserLifeEndLen=0;
unsigned char ucErrMsg[256];
memset(ucErrMsg,'\0',sizeof(ucErrMsg));
int iErrMsgLen=0;
int iRet=ReadIDCardComm(
iPort,
ucName,
iNamelen,
ucSex,
iSexLen,
ucIDNo,
iIDNoLen,
ucNation,
iNationLen,
ucBirthday,
iBirthdayLen,
ucAddress,
iAddressLen,
ucGrantDept,
iGrantDeptLen,
ucUserLifeBegin,
iUserLifeBeginLen,
ucUserLifeEnd,
iUserLifeEndLen,
ucErrMsg,
iErrMsgLen,
iTimeout);
if(0!=iRet)
{
CString strErrMsg="";
if (-2==iRet)
{
strErrMsg=strErrMsg+"读取身份证超时";
}
else
{
CString strT="";
strT=strT+UsignedCharToCStringA(ucErrMsg,iErrMsgLen);
int a=iErrMsgLen;
7
strErrMsg=strErrMsg+"读卡错误:"+strT;
}
return ;
}
CString m_strName=UsignedCharToCStringA(ucName,iNamelen);
CString m_strSex=UsignedCharToCStringA(ucSex,iSexLen);
CString m_strSfzNo=UsignedCharToCStringA(ucIDNo,iIDNoLen);
CString m_strNation=UsignedCharToCStringA(ucNation,iNationLen);
CString m_strBirthday=UsignedCharToCStringA(ucBirthday,iBirthdayLen);
CString m_strAddress=UsignedCharToCStringA(ucAddress,iAddressLen);
CString m_strGrantDept=UsignedCharToCStringA(ucGrantDept,iGrantDeptLen);
CString m_strUserLifeBegin=UsignedCharToCStringA(ucUserLifeBegin,iUserLifeBeginLen);
CString m_strUserLifeEnd=UsignedCharToCStringA(ucUserLifeEnd,iUserLifeEndLen);
}
谢谢大家的帮忙。使用用DLLcall时,无论怎么写都无法获取结果。改用ActiveX 控件对象方法,结果可以啦。
#PRE_UseX64=n
$oScript = ObjCreate("IDCARDREADER.IdCardReaderCtrl.1")
$oScript.SetTimeout(5000); //设置读取超时时间
$oScript.SetPort(1001); //设置 com 口号或 usb 后号
$oScript.SetPicPath("Z:\\ZP.bmp")
$iRet=$oScript.ReadIDCard(); //开始读取
If $iRet<>0 Then MsgBox(0,0,$oScript.GetErrMsg())
MsgBox(0,"身份证号",$oScript.GetIDNo())
发表于 2017-2-21 22:37:27 | 显示全部楼层
char* 就是一个指针,用ptr
 楼主| 发表于 2017-2-22 12:01:48 | 显示全部楼层
本帖最后由 仙乃日 于 2017-2-22 16:58 编辑

回复 2# haijie1223
更改为指针了,并且使用了结构体了,还是不行。
#include <array.au3>
Local $t_name = DllStructCreate("wchar[256]")
Local $p_name = DllStructGetPtr($t_name)
Local $Namelen = 0
Local $t_sex = DllStructCreate("wchar[256]")
Local $p_sex = DllStructGetPtr($t_sex)
Local $SexLen = 0
Local $t_IDNo = DllStructCreate("wchar[256]")
Local $p_IDNo = DllStructGetPtr($t_IDNo)
Local $IDNoLen = 0
Local $t_Nation = DllStructCreate("wchar[256]")
Local $p_Nation = DllStructGetPtr($t_Nation)
Local $NationLen = 0
Local $t_Birthday = DllStructCreate("wchar[256]")
Local $p_Birthday = DllStructGetPtr($t_Birthday)
Local $BirthdayLen = 0
Local $t_Address = DllStructCreate("wchar[256]")
Local $p_Address = DllStructGetPtr($t_Address)
Local $AddressLen = 0
Local $t_GrantDept = DllStructCreate("wchar[256]")
Local $p_GrantDept = DllStructGetPtr($t_GrantDept)
Local $GrantDeptLen = 0
Local $t_UserLifeBegin = DllStructCreate("wchar[256]")
Local $p_UserLifeBegin = DllStructGetPtr($t_UserLifeBegin)
Local $UserLifeBeginLen = 0
Local $t_UserLifeEnd = DllStructCreate("wchar[256]")
Local $p_UserLifeEnd = DllStructGetPtr($t_UserLifeEnd)
Local $UserLifeEndLenn = 0
Local $t_errMsg = DllStructCreate("wchar[1024]")
Local $p_errMsg = DllStructGetPtr($t_errMsg)
Local $errMsgLenn = 0
$aDllCallReturn=DllCall("IdReaderApiComm.dll","none","StopReadIDCardComm")
_ArrayDisplay($aDllCallReturn)
$aDllCallReturn = DllCall("IdReaderApiComm.dll", _
                "int", "ReadIDCardComm", _
                "int", 1001, _
                "ptr", $p_name, "int", $Namelen, _
                "ptr", $p_sex, "int", $SexLen, _
                "ptr", $p_IDNo, "int", $IDNoLen, _
                "ptr", $p_Nation, "int", $NationLen, _
                "ptr", $p_Birthday, "int", $BirthdayLen, _
                "ptr", $p_Address, "int", $AddressLen, _
                "ptr", $p_GrantDept, "int", $GrantDeptLen, _
                "ptr", $p_UserLifeBegin, "int", $UserLifeBeginLen, _
                "ptr", $p_UserLifeEnd, "int", $UserLifeEndLenn, _
                "ptr", $p_errMsg, "int", $errMsgLenn, _
                "int", 10000)
Local $name = DllStructGetData($t_name, 1)
MsgBox(0,$name,$aDllCallReturn[0])
_ArrayDisplay($aDllCallReturn)
发表于 2017-2-22 12:16:11 | 显示全部楼层
这个dll必须要借助于读卡器吗,空测可以吗,可以的话,发上来测试一下。
 楼主| 发表于 2017-2-22 12:31:53 | 显示全部楼层
这个dll必须要借助于读卡器吗,空测可以吗,可以的话,发上来测试一下。
haijie1223 发表于 2017-2-22 12:16



    应该要读卡器的,断开时运行就会提示AU3脚本已停止工作。
发表于 2017-2-24 08:49:26 | 显示全部楼层
既然$t_name = DllStructCreate("wchar[256]"),那么长度是不是应该
$Namelen =DllStructGetSize($t_name),而不是0
 楼主| 发表于 2017-2-24 10:02:39 | 显示全部楼层
回复 6# tubaba
$Namelen 是返回值
发表于 2017-2-24 13:35:38 | 显示全部楼层
回复 6# tubaba


    初始化传入Namelen 多长都可以,这个参数是输出的,输出的时候确实是Namelen 的长度。有dll内部函数自动完成。
发表于 2017-2-24 14:23:49 | 显示全部楼层
本帖最后由 nmgwddj 于 2017-2-24 14:28 编辑

先来看一下这个函数的原型:


int ReadIDCardComm(
        int iPort,
        unsigned char *ucName,
        int &iNamelen,
        unsigned char *ucSex,
        int &iSexLen,
        unsigned char *ucIDNo,
        int &iIDNoLen,
        unsigned char *ucNation,
        int &iNationLen,
        unsigned char *ucBirthday,
        int &iBirthdayLen,
        unsigned char *ucAddress,
        int &iAddressLen,
        unsigned char *ucGrantDept,
        int &iGrantDeptLen,
        unsigned char *ucUserLifeBegin,
        int &iUserLifeBeginLen,
        unsigned char *ucUserLifeEnd,
        int &iUserLifeEndLen,
        unsigned char *errMsg,
        int &iErrMsgLen,
        int nTimeOut
);


这个函数我一定在哪里见过,特别眼熟。
说实话我看到这个原型相当费解,到到底是 C 还是 C++ 封装的库?为什么引用和指针混用作为参数?
按道理来说,在 C 语言函数形参设计上,都应该是指针,且 C 语言没有引用这个概念。只有到了 C++ 才有这个概念。说白了,引用就是对一级指针的一层包装,通过这个函数的形参来看,又是指针又是引用,让人费解。
所有 int 类型的传出长度参数都都是引用,你只有把这个 int 数据的“地址”传递到函数中,函数内部才能修改这个 int 的值,像你现在这样用 au3 给它传参的方式,是值传递,而不是传递地址,函数内部修改不了,甚至可能会报错。所以调用失败。

我们来看一个 GetComputerName 的例子,这个 API 第二个参数就是一个 in out 的传入传出参数。


BOOL WINAPI GetComputerNameEx(
  _In_    COMPUTER_NAME_FORMAT NameType,
  _Out_   LPTSTR               lpBuffer,
  _Inout_ LPDWORD              lpnSize
);


我们在给其传递一个构造好的 int 类型数据时,要取得这个数据的指针也就是用 DllStructGetPtr 函数,取到 DllStructCreate 创建的 int 结构的地址传递进去。代码示例:


Const $MAX_COMPUTERNAME_LENGTH = 15 + 1

Local $stBuffer = DllStructCreate('char[' & $MAX_COMPUTERNAME_LENGTH & ']')
Local $stLength = DllStructCreate('int')
DllStructSetData($stLength, 1, $MAX_COMPUTERNAME_LENGTH)

DllCall('Kernel32.dll', 'bool', 'GetComputerName', 'ptr', DllStructGetPtr($stBuffer), 'ptr', DllStructGetPtr($stLength))

MsgBox(0, '', DllStructGetData($stBuffer, 1))


所以,你可以尝试讲所有长度封装为结构体,然后取到结构体指针传入给函数做参数看调用结果,另外要注意,别看函数形参给出的是一个 int 类型的引用,但你传递时要指定为 ptr,因为上面说过,引用就是对一级指针的一层包装。你可以试试这个方法,我不确定能否解决你的问题。

最后还是吐槽一下这个函数的形参设计,一大堆参数,为什么不设计成一个结构体!!!
 楼主| 发表于 2017-2-24 15:35:36 | 显示全部楼层
回复 9# nmgwddj
#include <array.au3>
Local $t_name = DllStructCreate("char[256]")
If @error Then MsgBox(0,0,@error)
Local $p_name = DllStructGetPtr($t_name)
Local $Namelen = DllStructCreate('int')
Local $t_sex = DllStructCreate("char[256]")
Local $p_sex = DllStructGetPtr($t_sex)
Local $SexLen =DllStructCreate('int')
Local $t_IDNo = DllStructCreate("char[256]")
Local $p_IDNo = DllStructGetPtr($t_IDNo)
Local $IDNoLen =DllStructCreate('int')
Local $t_Nation = DllStructCreate("char[256]")
Local $p_Nation = DllStructGetPtr($t_Nation)
Local $NationLen =DllStructCreate('int')
Local $t_Birthday = DllStructCreate("char[256]")
Local $p_Birthday = DllStructGetPtr($t_Birthday)
Local $BirthdayLen =DllStructCreate('int')
Local $t_Address = DllStructCreate("char[256]")
Local $p_Address = DllStructGetPtr($t_Address)
Local $AddressLen =DllStructCreate('int')
Local $t_GrantDept = DllStructCreate("char[256]")
Local $p_GrantDept = DllStructGetPtr($t_GrantDept)
Local $GrantDeptLen =DllStructCreate('int')
Local $t_UserLifeBegin = DllStructCreate("char[256]")
Local $p_UserLifeBegin = DllStructGetPtr($t_UserLifeBegin)
Local $UserLifeBeginLen =DllStructCreate('int')
Local $t_UserLifeEnd = DllStructCreate("char[256]")
Local $p_UserLifeEnd = DllStructGetPtr($t_UserLifeEnd)
Local $UserLifeEndLenn =DllStructCreate('int')
Local $t_errMsg = DllStructCreate("char[1024]")
Local $p_errMsg = DllStructGetPtr($t_errMsg)
Local $errMsgLenn =DllStructCreate('int')

$aDllCallReturn = DllCall("IdReaderApiComm.dll", _
                "int", "ReadIDCardComm", _
                "int", 1001, _
                "ptr", $p_name, "ptr", DllStructGetPtr($Namelen), _
                "ptr", $p_sex, "ptr", DllStructGetPtr($SexLen), _
                "ptr", $p_IDNo, "ptr", DllStructGetPtr($IDNoLen), _
                "ptr", $p_Nation, "ptr", DllStructGetPtr($NationLen), _
                "ptr", $p_Birthday, "ptr", DllStructGetPtr($BirthdayLen), _
                "ptr", $p_Address, "ptr", DllStructGetPtr($AddressLen), _
                "ptr", $p_GrantDept, "ptr", DllStructGetPtr($GrantDeptLen), _
                "ptr", $p_UserLifeBegin, "ptr", DllStructGetPtr($UserLifeBeginLen), _
                "ptr", $p_UserLifeEnd, "ptr", DllStructGetPtr($UserLifeEndLenn), _
                "ptr", $p_errMsg, "ptr", DllStructGetPtr($errMsgLenn), _
                "int", 5000)
Local $name = DllStructGetData($t_IDNo,1)
MsgBox(0,$name,$aDllCallReturn[0])
_ArrayDisplay($aDllCallReturn)
谢谢指导,不过更改成如上代码,依旧不行。
发表于 2017-2-24 16:38:46 | 显示全部楼层
回复 9# nmgwddj


    是挺奇怪的,应该是传入的参数是公共变量,其他函数可能会用到。
 楼主| 发表于 2017-2-24 16:39:44 | 显示全部楼层

其文档提供一个测试的网页。
<html>
        <head>
        <object id="IdCard" classid="clsid:CF402B93-059D-4572-A290-E7F39C6B2A86" 
                width="0px" height="0px"
                codebase="IdCard.CAB#version=1,0,0,0"
                onerror="onObjectError();"
        > </object >
        
        <script language="javascript">
        
                function SetPort()
                {
                        var szPort=document.getElementById("port").value;
                        //IdCard.SetPort(parseInt(szPort));
                        IdCard.SetTimeout(10000);
                        IdCard.SetPort(szPort);
                        alert("设置ok");
                }
                
                function Test()
                {
                        alert("开始读取");
                        //IdCard.ReadIDCard();
                        
                        
                        IdCard.SetPicPath("C:\\ZP.bmp"); //设置图片文件
                        //alert("set pic");
                        var iRet=IdCard.ReadIDCard();
                        if(iRet!=0)
                        {
                                alert(IdCard.GetErrMsg()); 
                                return;
                        }
                        alert("结束读取");

                        var ss="";
                        ss=ss+"姓名:"+IdCard.GetName()+"\n";
                        ss=ss+"性别:"+IdCard.GetSex()+"\n";
                        ss=ss+"身份证号:"+IdCard.GetIDNo()+"\n";
                        ss=ss+"民族:"+IdCard.GetNation()+"\n";
                        ss=ss+"地址:"+IdCard.GetAddress()+"\n";
                        ss=ss+"生日:"+IdCard.GetBirthday()+"\n";
                        ss=ss+"发卡机构:"+IdCard.GetGrantDept()+"\n";
                        ss=ss+"开始时间:"+IdCard.GetUserLifeBegin()+"\n";
                        ss=ss+"结束时间:"+IdCard.GetUserLifeEnd()+"\n";
                        
                        //alert(ss);
                        
                        var info = document.getElementById("info"); 
                        info.value = ss; 
                        
                        var imgPre = document.getElementById("imgPre"); 
                        imgPre.src = "C:\\ZP.bmp"; 
                        
                }

                
                
        </script>
        </head>
        <body>
                <br>
                请设置port口 
                <br>COM设成1-16 USB设成1001-1016
                <br>
                <input id="port" type="text" name="port" value="1001" >
                <br>
                <a href="javascript:SetPort()" >设置port口</a>
                <br>
                <br>
                <a href="javascript:Test()" >测试</a>
                <br>
                <br>
                结果
                <br>
                <br>
                <textarea id="info" style="width:200px;height:80px;"></textarea>
                <br>
                <img id="imgPre" src="" width="102px" height="126px" style="display: block;" /> 
        
        </body>
</html>
参考其代码,查找到ActiveX 控件对象。
在注册表中查找clsid:CF402B93-059D-4572-A290-E7F39C6B2A86
得到其项名:HKEY_CLASSES_ROOT\IDCARDREADER.IdCardReaderCtrl.1\CLSID
猜测"IDCARDREADER.IdCardReaderCtrl.1"就是ActiveX 控件对象。
测试一下,果然可以用。
发表于 2017-2-24 20:11:19 | 显示全部楼层
似乎可用
#NoTrayIcon
#RequireAdmin
#pre_usex64=n
#include <array.au3>
Global $tDataLen = DllStructCreate('int iNamelen;int iSexLen;int iIDNoLen;int iNationLen;int iBirthdayLen;int iAddressLen;int iGrantDeptLen;int iUserLifeBeginLen;int iUserLifeEndLen;int iErrMsgLen;')
Local $array = ReadIDCardComm()
ConsoleWrite(@error & @CRLF)
_ArrayDisplay($array, @error)

Func ReadIDCardComm($iPort = 1001, $nTimeOut = 10000)
        Local $aRet = DllCall("IdReaderApiComm.dll", _
                        "int", "ReadIDCardComm", _
                        "int", $iPort, _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 1), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 2), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 3), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 4), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 5), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 6), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 7), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 8), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 9), _
                        "wstr", '', "ptr", DllStructGetPtr($tDataLen, 10), _
                        "int", $nTimeOut)
        If Not @error Then Return $aRet
        Return SetError(@error, 0, 0)
EndFunc   ;==>ReadIDCardComm
发表于 2017-2-24 20:13:56 | 显示全部楼层
经测试返回值-1,你在你的读卡器电脑上试试
发表于 2017-2-24 20:39:18 | 显示全部楼层
回复 10# 仙乃日

看了下 dllcall 的帮助文档,写了如何以引用方式传递参数,你再修改一下试试。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-20 11:31 , Processed in 0.088517 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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