部分代碼如下:
Private AlarmInfo As NET_DVR_ALARMINFO
'結構體引數
Type NET_DVR_ALARMINFO
dwAlarmType As Long '報警型別
dwAlarmInputNumber As Long '報警輸入埠
dwAlarmOutputNumber(15) As Long '報警輸出埠
dwAlarmRelateChannel(15) As Long '觸發錄像通道
dwChannel(15) As Long '發生報警通道
dwDiskNumber(15) As Long '發生報警硬碟
End Type
'回呼函式
Public Function MSGCallBack(ByVal lCommand As Long, ByRef pAlarmer As NET_DVR_ALARMER, _
ByVal pAlarmInfo As Long, ByVal dwBufLen As Long, _
ByVal pUser As Long) As Boolean '回呼函式
Debug.Print 。。。
End Function
需要在回呼函式中要列印pAlarmInfo結構體的資訊,這個要怎么實作呢?
小白一枚,求大神指導呀 。.感謝!
uj5u.com熱心網友回復:
引數直接宣告為ByRef pAlarmInfo As NET_DVR_ALARMINFO就可以了。
然后 pAlarmInfo 這個結構的每個成員安裝一般除錯的方法直接 Debug.Print,或者專門寫個列印程序方便多處呼叫。
uj5u.com熱心網友回復:
@Tiger_Zhao
是這樣嗎?
Public Function MSGCallBack(ByVal lCommand As Long, ByRef pAlarmer As NET_DVR_ALARMER, _
ByRef pAlarmInfo As NET_DVR_ALARMINFO, ByVal dwBufLen As Long, _
ByVal pUser As Long) As Boolean '回呼函式
Debug.Print dwAlarmType
Debug.Print dwAlarmInputNumber
Debug.Print dwAlarmOutputNumber
Debug.Print dwAlarmType
Debug.Print dwAlarmType
Debug.Print dwAlarmType
End Function
可是沒有日志顯示啊?
uj5u.com熱心網友回復:
是這樣嗎?
Public Function MSGCallBack(ByVal lCommand As Long, ByRef pAlarmer As NET_DVR_ALARMER, _
ByRef pAlarmInfo As NET_DVR_ALARMINFO, ByVal dwBufLen As Long, _
ByVal pUser As Long) As Boolean '回呼函式
Debug.Print dwAlarmType
Debug.Print dwAlarmInputNumber
Debug.Print dwAlarmOutputNumber
Debug.Print dwAlarmType
Debug.Print dwAlarmType
Debug.Print dwAlarmType
End Function
可是沒有日志顯示啊?
uj5u.com熱心網友回復:
Debug.Print 是除錯輸出,和日志有什么關系?轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/92488.html
