|
发表于 2019-11-10 01:01:10
|
显示全部楼层
广东省佛山市
谢谢2楼提醒,总算成功调用了!!!
$SuperOCR = DllOpen(@ScriptDir & "SuperOCR.dll")
DllCall($SuperOCR, "int", "init")
Sleep(5000)
For $i = 0 To 8
$bImage = _INetGetSource('http://ggfw.gdhrss.gov.cn/ssologin/CaptchaImg?j=0.5434825', False)
$bBinary = Binary($bImage)
$CodeImage = FileOpen(@ScriptDir & 'CheckCode.png', 26)
FileWrite($CodeImage, $bImage)
$iLen = BinaryLen($bBinary)
Local $hMem = _MemGlobalAlloc($iLen, $GMEM_MOVEABLE)
DllStructSetData(DllStructCreate("byte[" & $iLen & "]", _MemGlobalLock($hMem)), 1, $bBinary)
;~ $CheckCode = DllCall($SuperOCR, "ptr", "ocr", "ptr", $hMem, "int", $iLen);搞了一天原来是$hMem搞错了!!!
$CheckCode = DllCall($SuperOCR, "ptr", "ocr", "ptr", _MemGlobalLock($hMem), "int", $iLen)
;~ _ArrayDisplay($CheckCode)
$p = DllStructCreate("char Code[256]", $CheckCode[0])
MsgBox(0, '成功识别:' & DllStructGetData($p, 1), "字符串指针:" & $CheckCode[0] & @CRLF & @CRLF & " 指针大小:" & DllStructGetSize($p) & @CRLF & @error)
Next
|
|