www.pudn.com > IP_phone.rar > NetSettingInfoDlg.cpp
// NetSettingInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "NC_Client.h"
#include "NetSettingInfoDlg.h"
#include "./tools/NetSettingInfo/NetSettingInfo.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNetSettingInfoDlg dialog
CNetSettingInfoDlg::CNetSettingInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNetSettingInfoDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CNetSettingInfoDlg)
m_adaptername = _T("");
m_des = _T("");
m_dhcp = _T("");
m_gateway = _T("");
m_hostname = _T("");
m_macaddress = _T("");
m_subnet = _T("");
m_type = _T("");
m_wins = _T("");
m_ipaddress = _T("");
//}}AFX_DATA_INIT
}
void CNetSettingInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNetSettingInfoDlg)
DDX_Control(pDX, IDOK, m_ok);
DDX_Text(pDX, IDC_ADAPTERNAME_EDIT, m_adaptername);
DDX_Text(pDX, IDC_DES_EDIT, m_des);
DDX_Text(pDX, IDC_DHCP_EDIT, m_dhcp);
DDX_Text(pDX, IDC_GATEWAY_EDIT, m_gateway);
DDX_Text(pDX, IDC_HOSTNAME_EDIT, m_hostname);
DDX_Text(pDX, IDC_MACADDRESS_EDIT, m_macaddress);
DDX_Text(pDX, IDC_SUBNET_EDIT, m_subnet);
DDX_Text(pDX, IDC_TYPE_EDIT, m_type);
DDX_Text(pDX, IDC_WINS_EDIT, m_wins);
DDX_Text(pDX, IDC_IPADDRESS_EDIT, m_ipaddress);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNetSettingInfoDlg, CDialog)
//{{AFX_MSG_MAP(CNetSettingInfoDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNetSettingInfoDlg message handlers
BOOL CNetSettingInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//使用CNetSettingInfo类
LPNETINFO netinfo;
CNetSettingInfo m_NetSettingInfo;
netinfo=m_NetSettingInfo.GetNetInfo();
ASSERT(netinfo);
//调用数据
m_hostname=netinfo->HostName;
m_adaptername=netinfo->AdapterName;
m_des=netinfo->Description;
m_type=netinfo->AdapterType;
m_macaddress=netinfo->MACAddress;
m_ipaddress=netinfo->IpAddress;
m_subnet=netinfo->SubNet;
m_gateway=netinfo->GateWay;
m_wins=netinfo->WinsServer;
m_dhcp=netinfo->DHCPServer;
//更新数据
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}