childframe1.cpp

来自「这个程序是一个个人考勤软件,它从系统时钟获取时间信息,可逐日记录下个人每天的工作」· C++ 代码 · 共 79 行

CPP
79
字号
// ChildFrame.cpp : implementation file
//

#include "stdafx.h"
#include "attendance.h"
#include "ChildFrame.h"

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

/////////////////////////////////////////////////////////////////////////////
// CChildFrame

IMPLEMENT_DYNCREATE(CChildFrame, CFrameWnd)

CChildFrame::CChildFrame()
{
}

CChildFrame::~CChildFrame()
{
}


BEGIN_MESSAGE_MAP(CChildFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CChildFrame)
	ON_WM_CREATE()
	ON_COMMAND(ID_PRINT_PREVIEW, OnPrintPreview)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	CCreateContext context;
	context.m_pNewViewClass = RUNTIME_CLASS(CChildView);
	context.m_pCurrentFrame = this;
	context.m_pCurrentDoc = NULL;
	context.m_pLastView = NULL;

	m_pView = STATIC_DOWNCAST(CChildView, CFrameWnd::CreateView(&context)); //CreateView(&context);
	if(m_pView != NULL)
	{
		m_pView->ShowWindow(SW_HIDE);//SHOW
		CFrameWnd::SetActiveView(m_pView);
	}

	
	return 0;
}

void CChildFrame::OnPrintPreview() 
{
	// TODO: Add your command handler code here
	//CAttendanceApp* app=(CAttendanceApp*)AfxGetApp();app->m_pChildFrame->
		m_pView->ShowWindow(SW_SHOW);//HIDE
		CFrameWnd::SetActiveView(m_pView);
	m_pView->OnFilePrintPreview(this);//(CFrameWnd *)
	
}
/*
void CChildFrame::OnPrint() 
{
	// TODO: Add your command handler code here
	//CAttendanceApp* app=(CAttendanceApp*)AfxGetApp();app->m_pChildFrame->
	m_pView->OnFilePrint();
	
}
*/

⌨️ 快捷键说明

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