代码如下,弹出到2 后,就报错, controls("cbocurchn") 是一个下拉框,没啥问题呀
.NET Framework 版本:2.0.50727.8937
Foxtable 版本:2018.9.9.1
错误所在事件:菜单,关闭设备,Click
详细错误信息:
未将对象引用设置到对象的实例。
msgbox(1)
BriSDKLib.QNV_CloseDevice(BriSDKLib.ODT_SOUND,0)'关闭声卡控制模块
msgbox(2)
Dim cboCurChn As WinForm.ComboBox = Forms("win_日常问题记录窗口").Controls("cboCurChn")
msgbox(3)
'删除事件接收
For i As Integer = 0 To cboCurChn.Items.Count - 1
BriSDKLib.QNV_Event(i,BriSDKLib.QNV_EVENT_UNREGWND,CType(basemainform.Handle, Int32),Nothing,Nothing,0)
Next
msgbox(4)
'关闭设备
If BriSDKLib.QNV_CloseDevice(BriSDKLib.ODT_ALL, 0) > 0 Then
cboCurChn.Items.Clear()
Forms("win_日常问题记录窗口").Controls("cboCurChn").Visible = False
' e.Form.Controls("gpbChnID").Visible = False
' e.Form.Controls("lblDrv").Visible = False
' e.Form.Controls("lblCurChn").Visible = False
' e.Form.Controls("btnCloseDrv").Enabled = False
vars("intChannelID") = -1
If EventForm IsNot Nothing Then
EventForm.Close() '关闭信息处理窗口
End If
vars("IsEventFormOpened") = False
AppendStatus("设备已关闭")
End If