/////////////////////////////////////////////////////////////////////////////// // // (c) Digi International Inc. 2003. 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/ // /////////////////////////////////////////////////////////////////////////////// // DeviceInfo.cpp : implementation file // #include "stdafx.h" #include "finder.h" #include "DeviceInfo.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDeviceInfo dialog CDeviceInfo::CDeviceInfo(CWnd* pParent /*=NULL*/) : CDialog(CDeviceInfo::IDD, pParent) { //{{AFX_DATA_INIT(CDeviceInfo) m_Details = _T(""); //}}AFX_DATA_INIT } void CDeviceInfo::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDeviceInfo) DDX_Text(pDX, IDC_DETAILS, m_Details); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDeviceInfo, CDialog) //{{AFX_MSG_MAP(CDeviceInfo) ON_BN_CLICKED(IDC_BUTTON1, OnOK) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDeviceInfo message handlers BOOL CDeviceInfo::OnInitDialog() { CDialog::OnInitDialog(); CString MacAddress, DhcpMode="N/A"; MacAddress.Format("%02x:%02x:%02x:%02x:%02x:%02x", m_DevInfo->mac_address[0], m_DevInfo->mac_address[1], m_DevInfo->mac_address[2], m_DevInfo->mac_address[3], m_DevInfo->mac_address[4], m_DevInfo->mac_address[5]); CString InterfaceAddress(inet_ntoa(m_DevInfo->interface_address)), IpAddress(inet_ntoa(m_DevInfo->ip_address)), SubnetMask(inet_ntoa(m_DevInfo->subnet_mask)), GatewayAddress(inet_ntoa(m_DevInfo->gateway_address)), DnsAddress(inet_ntoa(m_DevInfo->dns_address)); if(m_DevInfo->valid_data & ADDP_DEVICE_INFO_VALID_DATA_DHCP_MODE) DhcpMode = (m_DevInfo->dhcp_mode == ADDP_DHCP_MODE_ENABLED)? "Enabled":"Disabled"; m_Details.Format("Version: %lu\n" "Interface Address: %s\n" "Vendor ID: %lu\n" "MAC Address: %s\n" "IP Address: %s\n" "Subnet Mask: %s\n" "Gateway Address: %s\n" "DNS Address: %s\n" "DHCP Mode: %s\n" "Device Name: %s\n" "Domain: %s\n" "Hardware Type: %u\n" "Hardware Revision: %u\n" "Firmware Revision: %s\n" "RealPort Port: %u\n" "Product Name: %s\n" "Port Count: %u\n" "Advisory: %u\n", m_DevInfo->version, InterfaceAddress, m_DevInfo->vendor_id, (LPCTSTR)MacAddress, IpAddress, SubnetMask, GatewayAddress, DnsAddress, (LPCTSTR)DhcpMode, m_DevInfo->name, m_DevInfo->domain, m_DevInfo->hardware_type, m_DevInfo->hardware_revision, m_DevInfo->firmware_version, m_DevInfo->realport_port, m_DevInfo->product_name, m_DevInfo->port_count, m_DevInfo->advisory); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDeviceInfo::OnOK() { CDialog::OnOK(); }