PRB: MFC Active Document Appears to Hang When Printed from Internet ExplorerID: Q178060
|
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.
The Active Document View window is disabled during the print operation and not enabled on completion.
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
}
Internet Explorer issues the Print command to the Active Document server
through a call to IOleCommandTarget::Exec using the OLECMDID_PRINT
identifier. The BINDSCRB sample code demonstrates mapping this command to
ID_FILE_PRINT by adding the ON_OLECMD_PRINT macro to the document's OLECMD
map.
However, after printing, the Active Document server no longer accepts
input.
Q180152 HOWTO: Print from an Active Document Server
Additional query words: DocObject server DocObj Active Document
Keywords : kbole kbMFC kbVC kbIE500 AXSDKDocObjects AXSDKIEAutomation
Version : WINDOWS:3.0,3.01,3.02,4.0,4.01; WINNT:4.2,4.2b,5.0
Platform : WINDOWS winnt
Issue type : kbprb
Last Reviewed: April 30, 1999