www.pudn.com > endecipher.rar > CipherView.cpp


// CipherView.cpp : implementation of the CCipherView class 
// 
 
#include "stdafx.h" 
#include "Cipher.h" 
#include "Dlg_Caeser.h" 
 
#include "CipherDoc.h" 
#include "CipherView.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CCipherView 
 
IMPLEMENT_DYNCREATE(CCipherView, CView) 
 
BEGIN_MESSAGE_MAP(CCipherView, CView) 
	//{{AFX_MSG_MAP(CCipherView) 
		// NOTE - the ClassWizard will add and remove mapping macros here. 
		//    DO NOT EDIT what you see in these blocks of generated code! 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CCipherView construction/destruction 
 
CCipherView::CCipherView() 
{ 
	// TODO: add construction code here 
 
} 
 
CCipherView::~CCipherView() 
{ 
} 
 
BOOL CCipherView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CView::PreCreateWindow(cs); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CCipherView drawing 
 
void CCipherView::OnDraw(CDC* pDC) 
{ 
	CCipherDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	// TODO: add draw code for native data here 
	LPCTSTR ps; 
	CString s="《网络信息安全》课程设计"; 
	ps=(LPCTSTR) s; 
	pDoc->SetTitle(ps); 
 
	CRect rc; 
 
	GetClientRect(&rc); 
 
	CBitmap bm,*pbm; 
	BITMAP bmMetric; 
	bm.LoadBitmap(IDB_BITMAP1); 
	bm.GetBitmap(&bmMetric); 
 
	CDC memDC; 
	memDC.CreateCompatibleDC(pDC); 
	pbm=memDC.SelectObject(&bm); 
 
	pDC->StretchBlt(0,20,rc.right/2,rc.bottom-40, 
		&memDC,0,0,bmMetric.bmWidth,bmMetric.bmHeight,SRCCOPY); 
	memDC.SelectObject(pbm); 
	bm.DeleteObject(); 
	memDC.DeleteDC(); 
 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CCipherView diagnostics 
 
#ifdef _DEBUG 
void CCipherView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CCipherView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
 
CCipherDoc* CCipherView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCipherDoc))); 
	return (CCipherDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CCipherView message handlers