因一款开发的应用软件需要使用ID读卡器,所以将OUR_IDR.dll文件复制到foxtable安装目录下,开发的软件使用正常。但是将项目发布后,运行出现错误提示:"自定义函数“ID卡号”执行出错"。请教各位老师,应该如何处理,发布的项目可以脱离foxtable正常运行?谢谢
此主题相关图片如下:捕获2.png
全局代码
Public Declare Function idr_read_once Lib "OUR_IDR.dll" (ByRef pserial As Byte) As Byte 'ID读卡函数声明
Public Declare Function idr_beep Lib "OUR_IDR.dll" (ByVal xms As Long) As Byte 'ID驱动蜂鸣器函数声明
Public _IDKH As String 'ID卡号
自定义函数“ID卡号”
Dim status1 As Byte
Dim a As Integer
Dim mypiccserial(4) As Byte 'ID卡序列号
status1 = idr_read_once(mypiccserial(0))
If status1 = 0 Then
idr_beep(50) '2毫秒*50
a = (Convert.ToString(mypiccserial(1) * 256 * 256 * 256 + mypiccserial(2) * 256 * 256 + mypiccserial(3) * 256 + mypiccserial(4)))
'_IDKH = Format((a Mod 256 * 256) + (INT(a /(256 * 256)) Mod 256) * 100000,"00000000")
_IDKH = a
End If
窗口的TimerTick事件
If Forms("手持终端").Opened() AndAlso Forms.ActiveForm IsNot Nothing AndAlso Forms.ActiveForm.Name = "手持终端"
Functions.Execute("ID卡号")
Dim rykh As String = _IDKH '人员卡号
Dim pr As DataRow
If rykh <> "" Then
pr = DataTables("人员信息").Find("卡号 = '" & rykh & "'")
If pr Is Nothing Then
e.Form.Controls("TextBox2").Text = Nothing '单位
e.Form.Controls("TextBox3").Text = Nothing '编号
e.Form.Controls("TextBox4").Text = Nothing '姓名
MessageBox.Show("查无此记录!","提示")
_IDKH = ""
Else '非空
e.Form.Controls("TextBox2").Text = pr("单位")
e.Form.Controls("TextBox3").Text = pr("编号")
e.Form.Controls("TextBox4").Text = pr("姓名")
If pr("保留") = True And pr("单位") = "开发" Then
e.Form.Controls("Button6").Visible = True
Else
e.Form.Controls("Button6").Visible = False
End If
_IDKH = ""
End If
End If
End If
[此贴子已经被作者于2015/9/24 19:50:22编辑过]