www.pudn.com > 个人考勤软件开发实例配套代码.zip > ChildFrame1.cpp


// 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(); 
	 
} 
*/