|
|
发表于 2017-2-24 20:53:09
|
显示全部楼层
回复 15# nmgwddj
果然如此,又学到了。以前只知道是ptr*是直接到地址取值。原来*是引用。
那么上面的函数又可以精简了。
[au3]#NoTrayIcon
#RequireAdmin
#pre_usex64=n
#include <array.au3>
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', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'wstr', '', 'int*', '', _
'int', $nTimeOut)
If Not @error Then Return $aRet
Return SetError(@error, 0, 0)
EndFunc ;==>ReadIDCardComm[/au3] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|