// MatPassiveMode.cpp : implementation file // #include "stdafx.h" #include "StoneU_HC_OCX.h" #include "MatPassiveMode.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMatPassiveMode dialog CMatPassiveMode::CMatPassiveMode(CWnd* pParent /*=NULL*/) : CDialog(CMatPassiveMode::IDD, pParent) { //{{AFX_DATA_INIT(CMatPassiveMode) m_wListenPort = 0; m_MCastIP = _T(""); //}}AFX_DATA_INIT } void CMatPassiveMode::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CMatPassiveMode) DDX_Control(pDX, IDC_COMBOPROTOCOL, m_ProtocolCombo); DDX_Control(pDX, IDC_COMBODECCHAN, m_DecChanCombo); DDX_Text(pDX, IDC_LISTENPORT, m_wListenPort); DDX_Text(pDX, IDC_MCASTIP, m_MCastIP); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CMatPassiveMode, CDialog) //{{AFX_MSG_MAP(CMatPassiveMode) ON_BN_CLICKED(IDC_SET, OnSet) ON_CBN_SELCHANGE(IDC_COMBOPROTOCOL, OnSelchangeComboprotocol) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMatPassiveMode message handlers void CMatPassiveMode::OnSet() { // TODO: Add your control notification handler code here UpdateData(TRUE); // NET_DVR_MATRIX_PASSIVEMODE PassiveMode; // memset(&PassiveMode, 0, sizeof(PassiveMode)); // // PassiveMode.wTransProtol = m_ProtocolCombo.GetCurSel(); // PassiveMode.wPassivePort = m_wListenPort; // sprintf(PassiveMode.sMcastIP, "%s", m_MCastIP); // if (!NET_DVR_MatrixSetPassiveMode(m_lServerID, m_DecChanCombo.GetCurSel() + m_lStartChan, &PassiveMode)) // { // CString tmp; // tmp.Format("Error: NET_DVR_MatrixSetPassiveMode = %d", NET_DVR_GetLastError()); // AfxMessageBox(tmp); // return; // } // MessageBox("设置成功"); } BOOL CMatPassiveMode::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_DecChanCombo.ResetContent(); CString tmp; for (int i=0; i 1) { GetDlgItem(IDC_MCASTIP)->EnableWindow(TRUE); } else { GetDlgItem(IDC_MCASTIP)->EnableWindow(FALSE); } }