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

📄 ethernetspyview.cpp

📁 网卡驱动相关实例 这是和网卡NT KMD驱动程序有关的一些资料和例子。主要是以下三方面内容: 3.1 article 一些有用的文档 3.2 Canberra 网络诊听工具Ethern
💻 CPP
字号:
// EthernetSpyView.cpp : implementation of the CEthernetSpyView class
//

#include <stdio.h>

#include "stdafx.h"

#include "packet32.h"
#include "EthernetSpy.h"
#include "EthernetSpyReader.h"
#include "filter.h"
#include "EthernetSpyGlobStatsDlg.h"
#include "EthernetSpyPckTypeDlg.h"
#include "EthernetSpyDlg.h"
#include "EthernetSpyOptionsDlg.h"
#include "EthernetSpyDoc.h"
#include "EthernetSpyView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEthernetSpyView

IMPLEMENT_DYNCREATE(CEthernetSpyView, CView)

BEGIN_MESSAGE_MAP(CEthernetSpyView, CView)
	//{{AFX_MSG_MAP(CEthernetSpyView)
	ON_MESSAGE(WM_SPYDLGCLOSE, OnSpyDlgClose)
	ON_MESSAGE(WM_GLOBSTATSDLGCLOSE, OnGlobStatsDlgClose)
	ON_MESSAGE(WM_PCKTYPEDLGCLOSE, OnPckTypeDlgClose)
//	ON_MESSAGE(WM_THREADTERMINATED, OnThreadTerminated)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEthernetSpyView construction/destruction

CEthernetSpyView::CEthernetSpyView()
{
	// TODO: add construction code here
	
}

CEthernetSpyView::~CEthernetSpyView()
{
}

BOOL CEthernetSpyView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEthernetSpyView drawing

void CEthernetSpyView::OnDraw(CDC* pDC)
{
/*	CEthernetSpyDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// TODO: add draw code for native data here

	char Text[100];

	sprintf (Text, "Total: %i", pDoc->Stats.Total);
	pDC->TextOut (10, 10, CString (Text));

	sprintf (Text, "Broadcast: %i", pDoc->Stats.Broadcast);
	pDC->TextOut (10, 30, CString (Text));

	sprintf (Text, "Multicast: %i", pDoc->Stats.Multicast);
	pDC->TextOut (10, 50, CString (Text));

	SetTimer (1, 200, NULL);
*/
}

/////////////////////////////////////////////////////////////////////////////
// CEthernetSpyView printing

BOOL CEthernetSpyView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CEthernetSpyView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CEthernetSpyView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CEthernetSpyView diagnostics

#ifdef _DEBUG
void CEthernetSpyView::AssertValid() const
{
	CView::AssertValid();
}

void CEthernetSpyView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CEthernetSpyDoc* CEthernetSpyView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEthernetSpyDoc)));
	return (CEthernetSpyDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CEthernetSpyView message handlers

LRESULT CEthernetSpyView::OnSpyDlgClose(WPARAM, LPARAM)
{
	GetDocument () -> OnSpyDlgClose();
	
	return 1;
}
/*
LRESULT CEthernetSpyView::OnThreadTerminated(WPARAM, LPARAM)
{
	GetDocument()->OnTerminatedThread();
	
	return 1;
}
*/
LRESULT CEthernetSpyView::OnGlobStatsDlgClose(WPARAM, LPARAM)
{
	GetDocument() -> OnGlobStatsDlgClose();
	
	return 1;
}

LRESULT CEthernetSpyView::OnPckTypeDlgClose(WPARAM, LPARAM)
{
	GetDocument() -> OnPckTypeDlgClose();
	
	return 1;
}

⌨️ 快捷键说明

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