The information in this article applies to:
SYMPTOMSOnClose() is called when the user closes the Print Preview dialog box. CAUSE
If your frame window class is CMainFrame, for example, you can override the
OnClose() member to perform special processing (such as putting up a
message box asking users if they really want to quit), but note that
CMainFrame::OnClose() is also called when the user dismisses the Print
Preview dialog by pressing ALT+F4 or by double-clicking the upper left
corner of the dialog.
RESOLUTION
In your OnClose() function, you probably don't want to do the same
processing during a Print Preview close that you want to do during an
application close. Therefore, you should make a special case in the
OnClose() code to check whether or not it is being called from Print
Preview.
In this example, ID_EXIT_PROMPT is a string table resource containing the
string that you want to display in the message box. In addition, m_bPreview
is a member that you need to add to the CMainFrame class; it is initialized
to FALSE in the constructor of the CMainFrame class. Then, the m_bPreview
variable is set again using an override of CFrameWnd::OnSetPreviewMode().
STATUSThis behavior is by design. REFERENCESFor more information on Print Preview, please see MFC Technote 30, "Print Preview." Additional query words: 2.50 2.51 2.52 2.10 3.00 3.10 2.00 3.0 3.1 4.00 4.10
Keywords : kbMFC kbPrinting kbVC |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |