⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 countformview.cpp

📁 这是MFC经典问答书的光盘内容
💻 CPP
字号:
// CountFormView.cpp : implementation file
//

#include "stdafx.h"
#include "TwoViews.h"

#include "CountFormView.h"
#include "CountDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCountFormView

IMPLEMENT_DYNCREATE(CCountFormView, CFormView)

CCountFormView::CCountFormView()
	: CFormView(CCountFormView::IDD)
{
	//{{AFX_DATA_INIT(CCountFormView)
	m_nCount = 0;
	//}}AFX_DATA_INIT
}

CCountFormView::~CCountFormView()
{
}

void CCountFormView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCountFormView)
	DDX_Text(pDX, IDC_COUNTER, m_nCount);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCountFormView, CFormView)
	//{{AFX_MSG_MAP(CCountFormView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCountFormView diagnostics

#ifdef _DEBUG
void CCountFormView::AssertValid() const
{
	CFormView::AssertValid();
}

void CCountFormView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CCountFormView message handlers

void CCountFormView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	// Get the current data from our document
	CCountDoc* pDoc = static_cast< CCountDoc* >( GetDocument() );
	ASSERT_KINDOF( CCountDoc, pDoc );

	m_nCount = pDoc->m_nCount;

	// Show the current data in our edit controls
	UpdateData( FALSE );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -