// PageExtCmd.cpp : implementation file // #include "stdafx.h" #include "mgrnve.h" #include "ConnectionManager.h" #include "PageExtCmd.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPageExtCmd dialog CPageExtCmd::CPageExtCmd(CWnd* pParent, CMgrNVE* pMgrCM, CConnectionManager *pConnMgr) : CParamDlg(CPageExtCmd::IDD, pParent, pMgrCM, pConnMgr) { //{{AFX_DATA_INIT(CPageExtCmd) m_strRequest = _T(""); m_strResponse = _T(""); //}}AFX_DATA_INIT m_pNet5 = NULL; m_pMsgMgr = NULL; } void CPageExtCmd::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPageExtCmd) DDX_Control(pDX, IDC_CB_EXT_CMD, m_cbExtCmd); DDX_Text(pDX, IDC_EDT_REQUEST, m_strRequest); DDX_Text(pDX, IDC_EDT_RESPONSE, m_strResponse); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPageExtCmd, CDialog) //{{AFX_MSG_MAP(CPageExtCmd) ON_BN_CLICKED(IDC_BTN_SEND, OnBtnSend) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPageExtCmd message handlers BOOL CPageExtCmd::SaveSetting() { return TRUE; } BOOL CPageExtCmd::ResetSetting() { return TRUE; } BOOL CPageExtCmd::UpdateSetting() { return TRUE; } BOOL CPageExtCmd::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_pNet5 = m_pConnection->GetNet5Api(); m_pMsgMgr = m_pMgrNVE->GetMsgManager(); m_cbExtCmd.AddString("RTSP"); m_cbExtCmd.AddString("CGI"); m_cbExtCmd.SetCurSel(0); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CPageExtCmd::OnBtnSend() { // TODO: Add your control notification handler code here char szCmd[NVE_MAX_EXT_CMD_LENGTH]; UpdateData(TRUE); safe_strcpy(szCmd, (LPSTR)(LPCSTR)m_strRequest); TRACE(szCmd); switch(m_cbExtCmd.GetCurSel()) { case 0: safe_strcat(szCmd, "\r\n\r\n"); CHECK_AND_RETURN(m_pNet5->Net5Command(NET5_NC_SEND_RTSP_REQUEST, (ULONG*)szCmd, 0, 0, 0), "Cannot send RTSP request"); szCmd[0] = 0; CHECK_AND_RETURN(m_pNet5->Net5Command(NET5_NC_RECV_RTSP_RESPONSE, (ULONG*)szCmd, 0, 0, 0), "Cannot receive RTSP response"); break; case 1: CHECK_AND_RETURN(m_pNet5->Net5Command(NET5_NC_SEND_CGI_REQUEST, (ULONG*)szCmd, 0, 0, 0), "Cannot send CGI request"); szCmd[0] = 0; CHECK_AND_RETURN(m_pNet5->Net5Command(NET5_NC_RECV_CGI_RESPONSE, (ULONG*)szCmd, 0, 0, 0), "Cannot receive CGI response"); break; } m_strResponse = szCmd; UpdateData(FALSE); }