PRB: MFC Active Document Appears to Hang When Printed from Internet Explorer (178060)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 3.0
- Microsoft Internet Explorer (Programming) 3.01
- Microsoft Internet Explorer (Programming) 3.02
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2b
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2b
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q178060 SYMPTOMS
When an Active Document is viewed in Internet Explorer and the document is
printed using the IOLECommandTarget command mechanism, the Active Document
server appears to hang.
CAUSE
The Active Document View window is disabled during the print operation and
not enabled on completion.
RESOLUTION
Override CView::OnFilePrint(), the default handler for ID_FILE_PRINT, in
the Active Document server CView-derived class and insert a call to
EnableWindow() as follows:
void CMyView::OnFilePrint()
{
CView::OnFilePrint();
AfxGetMainWnd()->EnableWindow(); // TRUE by default
}
NOTE: Make sure you call the base-class OnFilePrint() before the call to
EnableWindow(). ClassWizard does not insert this call for you.
REFERENCES180152 HOWTO: Print from an Active Document Server
Modification Type: | Minor | Last Reviewed: | 3/16/2005 |
---|
Keywords: | kbprb KB178060 |
---|
|