www.pudn.com > EthernetSpy.zip > EthernetSpyOptionsDlg.cpp


// EthernetSpyOptionsDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
 
#include "packet32.h" 
#include "EthernetSpy.h" 
#include "EthernetSpyReader.h" 
#include "EthernetSpyOptionsDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CEthernetSpyOptionsDlg dialog 
 
 
CEthernetSpyOptionsDlg::CEthernetSpyOptionsDlg(EthernetSpyReader* _SpyReader, CWnd* pParent /*=NULL*/) 
	: CDialog(CEthernetSpyOptionsDlg::IDD, pParent) 
{ 
	SpyReader = _SpyReader; 
 
	//{{AFX_DATA_INIT(CEthernetSpyOptionsDlg) 
	m_Buff1 = SpyReader->MaxPkt; 
	m_Buff2 = SpyReader->BufLen; 
	m_Bytes = SpyReader->MaxFrameLen; 
	m_Timer = SpyReader->RefreshTime; 
	//}}AFX_DATA_INIT 
} 
 
 
void CEthernetSpyOptionsDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CEthernetSpyOptionsDlg) 
	DDX_Text(pDX, IDC_BUFF1, m_Buff1); 
	DDV_MinMaxUInt(pDX, m_Buff1, 100, 10000); 
	DDX_Text(pDX, IDC_BUFF2, m_Buff2); 
	DDV_MinMaxUInt(pDX, m_Buff2, 5, 150); 
	DDX_Text(pDX, IDC_BYTES, m_Bytes); 
	DDV_MinMaxUInt(pDX, m_Bytes, 64, 1514); 
	DDX_Text(pDX, IDC_TIMER, m_Timer); 
	DDV_MinMaxUInt(pDX, m_Timer, 10, 1000); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CEthernetSpyOptionsDlg, CDialog) 
	//{{AFX_MSG_MAP(CEthernetSpyOptionsDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CEthernetSpyOptionsDlg message handlers 
 
BOOL CEthernetSpyOptionsDlg::DestroyWindow()  
{ 
	SpyReader->MaxPkt = m_Buff1; 
	SpyReader->BufLen = m_Buff2; 
	SpyReader->MaxFrameLen = m_Bytes; 
	SpyReader->RefreshTime = m_Timer; 
	return CDialog::DestroyWindow(); 
} 
 
BOOL CEthernetSpyOptionsDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
}