private void ThermalCam_Load(object sender, EventArgs e) { Text = titleName; m_DisConnectCallBack = new fDisConnectCallBack(DisConnectCallBack); m_ReConnectCallBack = new fHaveReConnectCallBack(ReConnectCallBack); m_AnalyzerDataCallBack = new fAnalyzerDataCallBack(AnalyzerDataCallBack); m_AlarmCallBack = new fMessCallBackEx(AlarmCallBackEx); ip_textBox.Text = SensorIP; //Added by Chris InstallCACert(); try { ip_textBox.Text = SensorIP; //初始化 NETClient.Init(m_DisConnectCallBack, IntPtr.Zero, null); //打开日志 NET_LOG_SET_PRINT_INFO logInfo = new NET_LOG_SET_PRINT_INFO() { dwSize = (uint)Marshal.SizeOf(typeof(NET_LOG_SET_PRINT_INFO)) }; NETClient.LogOpen(logInfo); //设置断线重连回调 NETClient.SetAutoReconnect(m_ReConnectCallBack, IntPtr.Zero); NETClient.SetDVRMessCallBack(m_AlarmCallBack, IntPtr.Zero); } catch (Exception ex) { MessageBox.Show(ex.Message); Process.GetCurrentProcess().Kill(); } }
public BaseProccess() { disConnectCallBack = new fDisConnectCallBack(DisConnectCallBack); haveReConnectCallBack = new fHaveReConnectCallBack(ReConnectCallBack); analyzerDataCallBack = new fAnalyzerDataCallBack(AnalyzerDataCallBack); m_AlarmCallBack = new fMessCallBackEx(AlarmCallBackEx); m_ReConnectCallBack = new fHaveReConnectCallBack(ReConnectCallBack); NETClient.SetDVRMessCallBack(m_AlarmCallBack, IntPtr.Zero); NETClient.SetAutoReconnect(m_ReConnectCallBack, IntPtr.Zero); //set reconnect callback. try { NETClient.Init(disConnectCallBack, IntPtr.Zero, null); NETClient.SetAutoReconnect(haveReConnectCallBack, IntPtr.Zero); } catch (Exception ex) { Console.WriteLine("init = " + ex.Message); //Process.GetCurrentProcess().Kill(); } }
public static extern void CLIENT_SetDVRMessCallBackEx1(fMessCallBackEx cbMessage, IntPtr dwUser);