?? chapter05view.cpp
字號:
// Chapter05View.cpp : implementation of the CChapter05View class
//
#include "stdafx.h"
#include "Chapter05.h"
#include "Chapter05Doc.h"
#include "Chapter05View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChapter05View
IMPLEMENT_DYNCREATE(CChapter05View, CView)
BEGIN_MESSAGE_MAP(CChapter05View, CView)
//{{AFX_MSG_MAP(CChapter05View)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChapter05View construction/destruction
CChapter05View::CChapter05View()
{
// TODO: add construction code here
}
CChapter05View::~CChapter05View()
{
}
BOOL CChapter05View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CChapter05View drawing
void CChapter05View::OnDraw(CDC* pDC)
{
CChapter05Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CChapter05View diagnostics
#ifdef _DEBUG
void CChapter05View::AssertValid() const
{
CView::AssertValid();
}
void CChapter05View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CChapter05Doc* CChapter05View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CChapter05Doc)));
return (CChapter05Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChapter05View message handlers
void CChapter05View::IdleCounter(long lCount)
{
//定義字符串對象
CString strCount,strTem;
strTem="OnIdle已經被調用的次數為:";
//獲取設備上下文,以便在上面寫文字
pDc=GetWindowDC();
//格式化字符串
strCount.Format("%s%d",strTem,lCount);
//輸出文本
pDc->TextOut(100,100,strCount);
//刷新視圖的客戶區
Invalidate();
//設防資源
ReleaseDC(pDc);
//延遲,以便能看清顯示的文字(毫秒單位)
Sleep(100);
}
void CChapter05View::OnInitialUpdate()
{
CView::OnInitialUpdate();hjjkjk
// TODO: Add your specialized code here and/or call the base class
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -