PRB: MFC Active Document Appears to Hang When Printed from Internet Explorer
Article ID: 178060
Article Last Modified on 3/16/2005
APPLIES TO
- Microsoft Internet Explorer 3.0
- Microsoft Internet Explorer 3.01
- Microsoft Internet Explorer 3.02
- Microsoft Internet Explorer 4.0 128-Bit Edition
- Microsoft Internet Explorer 4.01 Service Pack 2
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
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.
REFERENCES
180152 HOWTO: Print from an Active Document Server
Additional query words: DocObject server DocObj Active Document
Keywords: kbprb KB178060