急救!新手 vb开发读写器设备 rf_load_key报错!!
我开发读写器程序,用的是明华的RF-35
我的代码如下:
Option Explicit
Dim akey(6) As Long
Dim bkey(6) As Long
Dim cardmode As Integer
Global loadmode As Integer
Private Sub Command1_Click()
loadmode = 0
If icdev < 0 Then
icdev = rf_init(0, 115200)
End If
If icdev < 0 Then
Label1.Caption = "Call rf_init() error.Exit!"
Exit Sub
End If
akey(0) = &HFF
akey(1) = &HFF
akey(2) = &HFF
akey(3) = &HFF
akey(4) = &HFF
akey(5) = &HFF
For sector = 0 To 15
st = rf_load_key(ByVal icdev, loadmode, sector, akey(0)) // 这里的akey(0)应该这样写吗?
If st <> 0 Then
Label1.Caption = "Call rf_load_key() error.Exit!" //报错
Exit Sub
End If
Next
等待中。。。。。。