// DecCfg.cpp : implementation file // #include "stdafx.h" #include "newclient.h" #include "DecCfg.h" #include "DecStatus.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDecCfg dialog CDecCfg::CDecCfg(CWnd* pParent /*=NULL*/) : CDialog(CDecCfg::IDD, pParent) { //{{AFX_DATA_INIT(CDecCfg) m_bChk = FALSE; m_Ip = _T(""); m_Port = 0; m_UserName = _T(""); m_Psw = _T(""); m_bChkTrans = FALSE; m_UserName1 = _T(""); m_Psw1 = _T(""); m_Ip2 = _T(""); m_Ip1 = _T(""); m_Port2 = 0; m_Port1 = 0; m_filename = _T(""); m_Ip3 = _T(""); m_Port3 = 0; m_ctDateStart = 0; m_ctDateStop = 0; m_ctTimeStart = 0; m_ctTimeStop = 0; m_UserName2 = _T(""); m_Psw2 = _T(""); //}}AFX_DATA_INIT } void CDecCfg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDecCfg) DDX_Control(pDX, IDC_COMBOPROTYPE1, m_ProTypeCtrl1); DDX_Control(pDX, IDC_COMBOPROTYPE, m_ProTypeCtrl); DDX_Control(pDX, IDC_COMCTRL, m_ctrl); DDX_Control(pDX, IDC_COMCHAN3, m_ChanCtrl2); DDX_Control(pDX, IDC_COMBOTYPE, m_typeCtrl); DDX_Control(pDX, IDC_COMCHAN2, m_ChanCtrl1); DDX_Control(pDX, IDC_COMBOSPECNO, m_specnoctrl); DDX_Control(pDX, IDC_COMBOPROTOCOL2, m_ProtCtrl1); DDX_Control(pDX, IDC_COMBODVRTRANS, m_DVRTransCtrl); DDX_Control(pDX, IDC_COMBO1, m_transctrl); DDX_Control(pDX, IDC_COMCHAN, m_ChanCtrl); DDX_Control(pDX, IDC_COMBOTIME, m_TimeCtrl); DDX_Control(pDX, IDC_COMBOPROTOCOL, m_ProtCtrl); DDX_Control(pDX, IDC_COMBONUM, m_NumCtrl); DDX_Control(pDX, IDC_COMBONO, m_NoCtrl); DDX_Control(pDX, IDC_COMBODECNUM, m_DecNumCtrl); DDX_Control(pDX, IDC_COMBODECNO, m_DecNoCtrl); DDX_Check(pDX, IDC_CHECK1, m_bChk); DDX_Text(pDX, IDC_EDITIP, m_Ip); DDX_Text(pDX, IDC_EDITPORT, m_Port); DDX_Text(pDX, IDC_EDITUSERNAME, m_UserName); DDX_Text(pDX, IDC_EDITUSERPSW, m_Psw); DDX_Check(pDX, IDC_CHKTRANS, m_bChkTrans); DDX_Text(pDX, IDC_EDITUSERNAME2, m_UserName1); DDX_Text(pDX, IDC_EDITUSERPSW2, m_Psw1); DDX_Text(pDX, IDC_EDITIP2, m_Ip2); DDX_Text(pDX, IDC_EDITIP3, m_Ip1); DDX_Text(pDX, IDC_EDITPORT2, m_Port2); DDX_Text(pDX, IDC_EDITPORT3, m_Port1); DDX_Text(pDX, IDC_EDITFILENAME, m_filename); DDX_Text(pDX, IDC_EDITIP4, m_Ip3); DDX_Text(pDX, IDC_EDITPORT4, m_Port3); DDX_DateTimeCtrl(pDX, IDC_DATESTART, m_ctDateStart); DDX_DateTimeCtrl(pDX, IDC_DATESTOP, m_ctDateStop); DDX_DateTimeCtrl(pDX, IDC_TIMESTART, m_ctTimeStart); DDX_DateTimeCtrl(pDX, IDC_TIMESTOP, m_ctTimeStop); DDX_Text(pDX, IDC_EDITUSERNAME3, m_UserName2); DDX_Text(pDX, IDC_EDITUSERPSW3, m_Psw2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDecCfg, CDialog) //{{AFX_MSG_MAP(CDecCfg) ON_CBN_SELCHANGE(IDC_COMBODECNO, OnSelchangeCombodecno) ON_CBN_SELCHANGE(IDC_COMBONO, OnSelchangeCombono) ON_BN_CLICKED(IDC_BUTOK, OnButok) ON_BN_CLICKED(IDC_BUTEXIT, OnButexit) ON_BN_CLICKED(IDC_BUTCHANOK, OnButchanok) ON_BN_CLICKED(IDC_BUTDECOK, OnButdecok) ON_BN_CLICKED(IDC_BUTSTARTDEC, OnButstartdec) ON_BN_CLICKED(IDC_BUTSTOPDEC, OnButstopdec) ON_BN_CLICKED(IDC_BUTSCREEN, OnButscreen) ON_BN_CLICKED(IDC_BUTTRANSOK, OnButtransok) ON_BN_CLICKED(IDC_BUTTRANSOK2, OnButtransok2) ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1) ON_BN_CLICKED(IDC_BUTCTRLDEC1, OnButctrldec1) ON_BN_CLICKED(IDC_BUTCTRLDEC2, OnButctrldec2) ON_BN_CLICKED(IDC_BUTCTRLDEC3, OnButctrldec3) ON_BN_CLICKED(IDC_BUTCTRLDEC4, OnButctrldec4) ON_BN_CLICKED(IDC_BUTCTRL, OnButctrl) ON_BN_CLICKED(IDC_BUTDEFAULT, OnButdefault) ON_BN_CLICKED(IDC_BUTSTATUS, OnButstatus) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDecCfg message handlers BOOL CDecCfg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CRect rc(0, 0, 0, 0); GetParent()->GetClientRect(&rc); ((CTabCtrl*)GetParent())->AdjustRect(FALSE, &rc); MoveWindow(&rc); m_NoCtrl.SetCurSel(0); m_NumCtrl.SetCurSel(0); m_ChanCtrl.SetCurSel(0); m_DecNoCtrl.SetCurSel(0); m_DecNumCtrl.SetCurSel(0); m_ProtCtrl.SetCurSel(0); m_TimeCtrl.SetCurSel(0); m_lSelWnd = 0; m_lSelDecNo = 0; m_lChannel = 0; if(NET_DVR_GetDecInfo(m_lServerID, 0, &Decoderinfo)) { m_NumCtrl.SetCurSel(Decoderinfo.dwDecChanNum); m_NoCtrl.SetCurSel(m_lSelWnd); m_bChk = Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll; m_TimeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime-1); m_DecNumCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans); m_DecNoCtrl.SetCurSel(m_lSelDecNo); m_ChanCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel-1); m_ProtCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode); m_ProTypeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType); m_UserName.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName); m_Psw.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword); m_Ip.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP); m_Port = Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort; } m_lSelTrans = 0; m_transctrl.SetCurSel(m_lSelTrans); if (NET_DVR_GetDecTransPort(m_lServerID, &TransPort)) { m_bChkTrans = TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort; m_DVRTransCtrl.SetCurSel(TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort-1); m_Ip2.Format("%s", TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP); m_Port2 = TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort; } else { AfxMessageBox("获取解码设备透明通道参数失败!"); } m_lChannel = 0; m_specnoctrl.SetCurSel(m_lChannel); m_ChanCtrl1.SetCurSel(0); m_ProtCtrl1.SetCurSel(0); m_UserName1.Format("%s", "admin"); m_Psw1.Format("%s", "12345"); m_Ip1.Format("%s", "0.0.0.0"); m_Port1 = 8000; m_Ip3.Format("%s", "0.0.0.0"); m_Port3 = 8000; m_typeCtrl.SetCurSel(0); m_ctrl.SetCurSel(0); m_ChanCtrl2.SetCurSel(0); m_filename = ""; UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDecCfg::OnOK() { // TODO: Add extra validation here // CDialog::OnOK(); } void CDecCfg::OnCancel() { // TODO: Add extra cleanup here // CDialog::OnCancel(); } void CDecCfg::OnSelchangeCombodecno() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelDecNo = m_DecNoCtrl.GetCurSel(); m_ChanCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel-1); m_ProtCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode); m_ProTypeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType); m_UserName.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName); m_Psw.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword); m_Ip.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP); m_Port = Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort; UpdateData(FALSE); } void CDecCfg::OnSelchangeCombono() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelWnd = m_NoCtrl.GetCurSel(); m_bChk = Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll; m_TimeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime-1); m_DecNumCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans); m_DecNoCtrl.SetCurSel(m_lSelDecNo); m_ChanCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel-1); m_ProtCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode); m_ProTypeCtrl.SetCurSel(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType); m_UserName.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName); m_Psw.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword); m_Ip.Format("%s", Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP); m_Port = Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort; UpdateData(FALSE); } void CDecCfg::OnButok() { // TODO: Add your control notification handler code here UpdateData(TRUE); Decoderinfo.dwDecChanNum = m_NumCtrl.GetCurSel(); m_lSelWnd = m_NoCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll = m_bChk; Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime = m_TimeCtrl.GetCurSel()+1; Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans = m_DecNumCtrl.GetCurSel(); m_lSelDecNo = m_DecNoCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel = m_ChanCtrl.GetCurSel()+1; Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode = m_ProtCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType = m_ProTypeCtrl.GetCurSel(); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName, m_UserName, NAME_LEN); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword, m_Psw, PASSWD_LEN); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP, m_Ip, 16); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort = m_Port; if(NET_DVR_SetDecInfo(m_lServerID, 0, &Decoderinfo)) { AfxMessageBox("设置参数成功!"); } else { AfxMessageBox("设置参数失败!"); } } void CDecCfg::OnButexit() { // TODO: Add your control notification handler code here // CDialog::OnOK(); } void CDecCfg::OnButchanok() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelWnd = m_NoCtrl.GetCurSel(); m_lSelDecNo = m_DecNoCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel = m_ChanCtrl.GetCurSel()+1; Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode = m_ProtCtrl.GetCurSel(); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName, m_UserName, NAME_LEN); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword, m_Psw, PASSWD_LEN); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP, m_Ip, 16); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort = m_Port; Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType = m_ProTypeCtrl.GetCurSel(); } void CDecCfg::OnButdecok() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelWnd = m_NoCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].byEnablePoll = m_bChk; Decoderinfo.struDecInfo[m_lSelWnd].byPoolTime = m_TimeCtrl.GetCurSel()+1; Decoderinfo.struDecInfo[m_lSelWnd].byPoolChans = m_DecNumCtrl.GetCurSel(); m_lSelDecNo = m_DecNoCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byChannel = m_ChanCtrl.GetCurSel()+1; Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkMode = m_ProtCtrl.GetCurSel(); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].byLinkType = m_ProTypeCtrl.GetCurSel(); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sUserName, m_UserName, NAME_LEN); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sPassword, m_Psw, PASSWD_LEN); memcpy(Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].sDVRIP, m_Ip, 16); Decoderinfo.struDecInfo[m_lSelWnd].struchanConInfo[m_lSelDecNo].wDVRPort = m_Port; } void CDecCfg::OnButstartdec() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); NET_DVR_DECCHANINFO DecChanInfo; DecChanInfo.byChannel = m_ChanCtrl1.GetCurSel()+1; DecChanInfo.byLinkMode = m_ProtCtrl1.GetCurSel(); DecChanInfo.byLinkType = m_ProTypeCtrl1.GetCurSel(); memcpy(DecChanInfo.sUserName, m_UserName1, NAME_LEN); memcpy(DecChanInfo.sPassword, m_Psw1, PASSWD_LEN); memcpy(DecChanInfo.sDVRIP, m_Ip1, 16); DecChanInfo.wDVRPort = m_Port1; if (!NET_DVR_StartDecSpecialCon(m_lServerID, m_lChannel+m_lStartChan, &DecChanInfo)) { AfxMessageBox("启动动态连接失败!"); } } void CDecCfg::OnButstopdec() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); NET_DVR_DECCHANINFO DecChanInfo; DecChanInfo.byChannel = m_ChanCtrl1.GetCurSel()+1; DecChanInfo.byLinkMode = m_ProtCtrl1.GetCurSel(); DecChanInfo.byLinkType = m_ProTypeCtrl1.GetCurSel(); memcpy(DecChanInfo.sUserName, m_UserName1, NAME_LEN); memcpy(DecChanInfo.sPassword, m_Psw1, PASSWD_LEN); memcpy(DecChanInfo.sDVRIP, m_Ip1, 16); DecChanInfo.wDVRPort = m_Port1; if(!NET_DVR_StopDecSpecialCon(m_lServerID, m_lChannel+m_lStartChan, &DecChanInfo)) { AfxMessageBox("停止动态连接失败!"); } } void CDecCfg::OnButscreen() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); if (!NET_DVR_DecCtrlScreen(m_lServerID, m_lChannel+m_lStartChan, 1)) { AfxMessageBox("全屏操作失败!"); } } void CDecCfg::OnButtransok() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelTrans = m_transctrl.GetCurSel(); TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort = m_bChkTrans; memcpy(TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP, m_Ip2, 16); TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort = m_Port2; TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort = m_DVRTransCtrl.GetCurSel()+1; if (NET_DVR_SetDecTransPort(m_lServerID, &TransPort)) { AfxMessageBox("设置解码设备透明通道参数成功!"); } else { AfxMessageBox("设置解码设备透明通道参数失败!"); } } void CDecCfg::OnButtransok2() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelTrans = m_transctrl.GetCurSel(); TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort = m_bChkTrans; memcpy(TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP, m_Ip2, 16); TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort = m_Port2; TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort = m_DVRTransCtrl.GetCurSel()+1; } void CDecCfg::OnSelchangeCombo1() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lSelTrans = m_transctrl.GetCurSel(); m_bChkTrans = TransPort.struTransPortInfo[m_lSelTrans].dwEnableTransPort; m_DVRTransCtrl.SetCurSel(TransPort.struTransPortInfo[m_lSelTrans].wDVRTransPort-1); m_Ip2.Format("%s", TransPort.struTransPortInfo[m_lSelTrans].sDecoderIP); m_Port2 = TransPort.struTransPortInfo[m_lSelTrans].wDecoderPort; UpdateData(FALSE); } void CDecCfg::OnButctrldec1() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_STARTDEC)) { AfxMessageBox("启动解码失败!"); } } void CDecCfg::OnButctrldec2() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_STOPDEC)) { AfxMessageBox("停止解码失败!"); } } void CDecCfg::OnButctrldec3() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_STOPCYCLE)) { AfxMessageBox("停止轮巡失败!"); } } void CDecCfg::OnButctrldec4() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); if (!NET_DVR_DecCtrlDec(m_lServerID, m_lChannel+m_lStartChan, NET_DEC_CONTINUECYCLE)) { AfxMessageBox("恢复轮巡失败!"); } } void CDecCfg::OnButctrl() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); NET_DVR_PLAYREMOTEFILE RemoteFileInfo; RemoteFileInfo.dwSize = sizeof(NET_DVR_PLAYREMOTEFILE); memcpy(RemoteFileInfo.sDecoderIP, m_Ip3, 16); RemoteFileInfo.wDecoderPort = m_Port3; RemoteFileInfo.wLoadMode = m_typeCtrl.GetCurSel()+1; if (m_typeCtrl.GetCurSel() == 0) { memcpy(RemoteFileInfo.mode_size.byFile, m_filename, 100); } else { RemoteFileInfo.mode_size.bytime.dwChannel = m_ChanCtrl2.GetCurSel()+1; memcpy(RemoteFileInfo.mode_size.bytime.sUserName, m_UserName2, NAME_LEN); memcpy(RemoteFileInfo.mode_size.bytime.sPassword, m_Psw2, PASSWD_LEN); RemoteFileInfo.mode_size.bytime.struStartTime.dwYear = (WORD)m_ctDateStart.GetYear(); RemoteFileInfo.mode_size.bytime.struStartTime.dwMonth = (WORD)m_ctDateStart.GetMonth(); RemoteFileInfo.mode_size.bytime.struStartTime.dwDay = (WORD)m_ctDateStart.GetDay(); RemoteFileInfo.mode_size.bytime.struStartTime.dwHour = (char)m_ctTimeStart.GetHour(); RemoteFileInfo.mode_size.bytime.struStartTime.dwMinute = (char)m_ctTimeStart.GetMinute(); RemoteFileInfo.mode_size.bytime.struStartTime.dwSecond = (char)m_ctTimeStart.GetSecond(); RemoteFileInfo.mode_size.bytime.struStopTime.dwYear = (WORD)m_ctDateStop.GetYear(); RemoteFileInfo.mode_size.bytime.struStopTime.dwMonth = (WORD)m_ctDateStop.GetMonth(); RemoteFileInfo.mode_size.bytime.struStopTime.dwDay = (WORD)m_ctDateStop.GetDay(); RemoteFileInfo.mode_size.bytime.struStopTime.dwHour = (char)m_ctTimeStop.GetHour(); RemoteFileInfo.mode_size.bytime.struStopTime.dwMinute = (char)m_ctTimeStop.GetMinute(); RemoteFileInfo.mode_size.bytime.struStopTime.dwSecond = (char)m_ctTimeStop.GetSecond(); } if (!NET_DVR_DecPlayBackCtrl(m_lServerID, m_lChannel+m_lStartChan, m_ctrl.GetCurSel()+1, 0, NULL, &RemoteFileInfo)) { AfxMessageBox("控制回放文件失败!"); } } /* void CDecCfg::OnButstatus() { // TODO: Add your control notification handler code here TRACE("hello"); CDecStatus Dlg; UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); Dlg.m_lServerID = m_lServerID; Dlg.m_lChannel = m_lChannel; Dlg.m_lStartChan = m_lStartChan; Dlg.DoModal(); } */ void CDecCfg::OnButdefault() { // TODO: Add your control notification handler code here UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); if (!NET_DVR_DecCtrlScreen(m_lServerID, m_lChannel+m_lStartChan, 2)) { AfxMessageBox("还原操作失败!"); } } void CDecCfg::OnButstatus() { // TODO: Add your control notification handler code here CDecStatus Dlg; UpdateData(TRUE); m_lChannel = m_specnoctrl.GetCurSel(); Dlg.m_lServerID = m_lServerID; Dlg.m_lChannel = m_lChannel; Dlg.m_lStartChan = m_lStartChan; Dlg.DoModal(); }