www.pudn.com > Test.rar > TestView.cpp


// TestView.cpp : implementation of the CTestView class 
// 
 
#include "stdafx.h" 
#include "Test.h" 
 
#include "TestDoc.h" 
#include "TestView.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CTestView 
 
IMPLEMENT_DYNCREATE(CTestView, CFormView) 
 
BEGIN_MESSAGE_MAP(CTestView, CFormView) 
	//{{AFX_MSG_MAP(CTestView) 
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1) 
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2) 
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3) 
	ON_BN_DOUBLECLICKED(IDC_BUTTON2, OnDoubleclickedButton2) 
	//}}AFX_MSG_MAP 
	// Standard printing commands 
	ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint) 
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint) 
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview) 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CTestView construction/destruction 
 
CTestView::CTestView() 
	: CFormView(CTestView::IDD) 
,aaa("") 
{ 
	//{{AFX_DATA_INIT(CTestView) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
	// TODO: add construction code here 
	SetWindowText(""); 
 
} 
 
CTestView::~CTestView() 
{ 
} 
 
void CTestView::DoDataExchange(CDataExchange* pDX) 
{ 
	CFormView::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CTestView) 
		// NOTE: the ClassWizard will add DDX and DDV calls here 
	//}}AFX_DATA_MAP 
	DDX_Text(pDX, IDC_EDIT4, aaa); 
} 
 
BOOL CTestView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CFormView::PreCreateWindow(cs); 
} 
 
void CTestView::OnInitialUpdate() 
{ 
	CFormView::OnInitialUpdate(); 
	ResizeParentToFit(); 
 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CTestView printing 
 
BOOL CTestView::OnPreparePrinting(CPrintInfo* pInfo) 
{ 
	// default preparation 
	return DoPreparePrinting(pInfo); 
} 
 
void CTestView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add extra initialization before printing 
} 
 
void CTestView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add cleanup after printing 
} 
 
void CTestView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add customized printing code here 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CTestView diagnostics 
 
#ifdef _DEBUG 
void CTestView::AssertValid() const 
{ 
	CFormView::AssertValid(); 
} 
 
void CTestView::Dump(CDumpContext& dc) const 
{ 
	CFormView::Dump(dc); 
} 
 
CTestDoc* CTestView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTestDoc))); 
	return (CTestDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CTestView message handlers 
 
void CTestView::OnButton1()  
{ 
	// TODO: Add your control notification handler code here 
 
 
} 
 
void CTestView::OnButton2()  
{ 
	// TODO: Add your control notification handler code here 
	 
} 
void CTestView::OnButton3()  
{ 
	// TODO: Add your control notification handler code here 
	aaa=CString("FB 03 00 00 80"); 
	UpdateData(false); 
 
} 
 
void CTestView::OnDoubleclickedButton2()  
{ 
	// TODO: Add your control notification handler code here 
	 
}