📄 sendpktview.cpp
字号:
// SendPktView.cpp : implementation of the CSendPktView class
//
#include "stdafx.h"
#include "SendPkt.h"
#include "SendPktDoc.h"
#include "SendPktView.h"
#include "EthernetDlg.h"
#include "IpHeaderSetupDlg.h"
#include "global.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSendPktView
IMPLEMENT_DYNCREATE(CSendPktView, CView)
BEGIN_MESSAGE_MAP(CSendPktView, CView)
//{{AFX_MSG_MAP(CSendPktView)
ON_COMMAND(IDM_IPHEADERSETUP, OnIpHeaderSetup)
ON_COMMAND(IDM_ETHERNET, OnEthernet)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CSendPktView construction/destruction
CSendPktView::CSendPktView()
{
// TODO: add construction code here
}
CSendPktView::~CSendPktView()
{
}
BOOL CSendPktView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CSendPktView drawing
void CSendPktView::OnDraw(CDC* pDC)
{
CSendPktDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CSendPktView printing
BOOL CSendPktView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CSendPktView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CSendPktView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CSendPktView diagnostics
#ifdef _DEBUG
void CSendPktView::AssertValid() const
{
CView::AssertValid();
}
void CSendPktView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CSendPktDoc* CSendPktView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSendPktDoc)));
return (CSendPktDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSendPktView message handlers
void CSendPktView::OnIpHeaderSetup()
{
// TODO: Add your command handler code here
CIpHeaderSetupDlg dlg;
int retCode;
retCode=dlg.DoModal();
if(retCode==IDOK)
{
memset(&g_IpFrame,0,sizeof(g_IpFrame));
FillIpHeader(&dlg);
}
}
void CSendPktView::OnEthernet()
{
// TODO: Add your command handler code here
CEthernetDlg dlg;
dlg.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -