/////////////////////////////////////////////////////////////////////////////// // // (c) Digi International Inc. 2002. All Rights Reserved // // Digi provides this document "as is," without warranty of any kind, // either expressed or implied, including, but not limited to, the implied // warranties of fitness or merchantability for a particular purpose. Digi // may make improvements and/or changes in this document or in the product(s) // and/or the program(s) described in this document at any time. // // This document could include technical inaccuracies or typographical errors. // Changes are periodically made to the information herein; these changes may // be incorporated in new editions of the publication. // // Digi International Inc. // 11001 Bren Road East // Minnetonka, MN 55343, USA // Tel: +1 (952) 912-3444 // Fax: +1 (952) 912-4952 // http://www.digi.com/ // /////////////////////////////////////////////////////////////////////////////// // Network.cpp : implementation file // #include "stdafx.h" #include "resource.h" #include "Network.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CNetwork dialog CNetwork::CNetwork(CWnd* pParent /*=NULL*/) : CDialog(CNetwork::IDD, pParent) { //{{AFX_DATA_INIT(CNetwork) m_Port = 0; //}}AFX_DATA_INIT } void CNetwork::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CNetwork) DDX_Control(pDX, IDC_IPADDRESS, m_IPAddressCtrl); DDX_Text(pDX, IDC_PORT, m_Port); DDV_MinMaxUInt(pDX, m_Port, 0, 65535); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CNetwork, CDialog) //{{AFX_MSG_MAP(CNetwork) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CNetwork message handlers BOOL CNetwork::OnInitDialog() { CDialog::OnInitDialog(); m_IPAddressCtrl.SetAddress(10, 0, 0, 1); m_Port = 2101; UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CNetwork::OnOK() { UpdateData(TRUE); IN_ADDR IPToString; m_IPAddressCtrl.GetAddress(IPToString.S_un.S_un_b.s_b1, IPToString.S_un.S_un_b.s_b2, IPToString.S_un.S_un_b.s_b3, IPToString.S_un.S_un_b.s_b4); m_IPAddress = inet_ntoa(IPToString); CDialog::OnOK(); }