String ls_ybkh
string writestr
string readstr
string Password
int st
int icdev
string ls_card_no,ls_credit_card_no,ls_name
string ls_medical_card_no
datetime ldt_startdate, ldt_enddate
string ls_condition,ls_return[]
icdev = Ic_InitComm_Baud(0,19200) //初始化串口一
If icdev <= 0 Then
Ic_PosBeep(icdev,3)
MessageBox('错误提示:','读卡设备初始化失败!')
return
End If
st = IC_Status(icdev) //取状态
If st < 0 Then
Ic_PosBeep(icdev,3)
MessageBox('错误提示:','读卡设备没有准备好!')
return
End If
If st = 1 Then
Ic_PosBeep(icdev,3)
MessageBox('错误提示:','请插入卡!')
return
End If
readstr=space(16)
st = IC_Check_4428(icdev) //给卡型号
If st <> 0 Then
Ic_PosBeep(icdev,3)
MessageBox('错误提示:','你插的卡无效!')
return
End If
if This.text = "IC卡(&R)" then
gf_yb_waiting("正在进行读卡...")
SetPointer(HourGlass!)
st = IC_Read(icdev,64, 16,ls_ybkh)
If st <> 0 Then
Ic_PosBeep(icdev,3)
MessageBox('错误提示:','读卡出错!')
return
End If
if u_ybjk.if_request(20,u_ybjk.is_hospitalcode+ "," + ls_ybkh,ls_return[]) then
This.text = "确定(&O)"
wf_Display()
else
MessageBox('提示:',u_ybjk.uf_GetLastErrText())
end if
SetPointer(Arrow!)
else
closewithReturn(parent,1)
end if
Ic_PosBeep(icdev,3)
st = IC_Down(icdev) //下电
If st < 0 Then
Ic_PosBeep(icdev,3)
MessageBox('错误提示:','设备下电出错!')
return
End If
------解决方案--------------------
你设置断点跟踪一下,一定是第一次读卡后,设备或者内存没有释放,跟踪一下,看是执行到哪里的时候报错退出
------解决方案--------------------
设备初始化后,再调用时就不用再初始了
------解决方案--------------------
应该是初始化后没有调用释放函数。
------解决方案--------------------
String ls_ybkh
string writestr
string readstr
string Password
int st
int icdev
string ls_card_no,ls_credit_card_no,ls_name
string ls_medical_card_no
datetime ldt_startdate, ldt_enddate
string ls_condition,ls_return[]
ls_ybkh = space(128)
请添加以上线色代码试试看.