⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 activehostdlg.cpp

📁 动态的发现某个路由器的所有子网的拓扑结构
💻 CPP
字号:
// ActiveHostDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MySnmp.h"
#include "ActiveHostDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CActiveHostDlg dialog


CActiveHostDlg::CActiveHostDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CActiveHostDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CActiveHostDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CActiveHostDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CActiveHostDlg)
	DDX_Control(pDX, IDC_LIST1, m_ctrlList);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CActiveHostDlg, CDialog)
	//{{AFX_MSG_MAP(CActiveHostDlg)
	ON_WM_CLOSE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CActiveHostDlg message handlers

BOOL CActiveHostDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	if(m_pActiveHosts!=NULL)
	{
		m_ctrlList.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
		m_ctrlList.InsertColumn(0,"主机IP地址",LVCFMT_LEFT,150);
		m_ctrlList.InsertColumn(1,"状态",LVCFMT_LEFT,150);
		for(int i=0;i<m_pActiveHosts->GetSize();i++)
		{
			char buf[10];
			sprintf(buf,"%d",i);
			int nItem=m_ctrlList.InsertItem(i,buf);
			m_ctrlList.SetItemText(nItem,0,m_pActiveHosts->GetAt(i));
			m_ctrlList.SetItemText(nItem,1,"活动的");
		}
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CActiveHostDlg::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
//	if()
	CDialog::OnClose();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -