void CG2XPreviewView::OnPreviewPrint() { if (m_hDialog) { ::PostMessage(m_hDialog, WM_COMMAND, ID_FILE_PRINT, 0); } else { // the view created for the dialog needs to set the m_pDialog pointer ASSERT(FALSE); } OnPreviewClose(); // force close of Preview }
void CPreviewViewEx::OnPreviewPrint() { // code taken from mfc's base class.. // CPreviewView::OnPreviewPrint(); OnPreviewClose(); // force close of Preview // set variable with view to print... // app.m_lngPrintViewID = ; // cause print (can be overridden by catching the command) CWnd* pMainWnd = AfxGetThread()->m_pMainWnd; ASSERT_VALID(pMainWnd); pMainWnd->SendMessage(WM_COMMAND, ID_FILE_PRINT_FROM_PREVIEW); // clear view variable app.m_lngPrintViewID = 0; }
void CG2XPreviewView::ClosePreview() { OnPreviewClose(); }