// MyPreviewView.cpp : ʵÏÖÎļþ // #include "stdafx.h" #include "MyPreviewView.h" #include ".\mypreviewview.h" #include // CMyPreviewView IMPLEMENT_DYNCREATE(CMyPreviewView, CPreviewView) CMyPreviewView::CMyPreviewView() { } CMyPreviewView::~CMyPreviewView() { } BEGIN_MESSAGE_MAP(CMyPreviewView, CPreviewView) ON_COMMAND(AFX_ID_PREVIEW_PRINT, OnPreviewPrint) ON_COMMAND(AFX_ID_PREVIEW_CLOSE, OnPreviewClose) END_MESSAGE_MAP() // CMyPreviewView Õï¶Ï #ifdef _DEBUG void CMyPreviewView::AssertValid() const { CPreviewView::AssertValid(); } void CMyPreviewView::Dump(CDumpContext& dc) const { CPreviewView::Dump(dc); } #endif //_DEBUG void CMyPreviewView::SetPrintWnd(CPrintXDlg *pWnd) { m_pPrintWnd = pWnd; } void CMyPreviewView::OnPreviewPrint() { if(m_pPrintWnd != NULL) { m_pPrintWnd->OnBnClickedPrint(); } OnPreviewClose(); } void CMyPreviewView::OnPreviewClose() { if(m_pPrintWnd != NULL) { CFrameWnd *pFrameWnd = m_pPrintWnd->m_pPrintFrameWnd; pFrameWnd->SendMessage(WM_CLOSE, 0, 0); } }