PRB: MFC Active Document Appears to Hang When Printed from IE

Last reviewed: December 15, 1997
Article ID: Q178060
The information in this article applies to:
  • Microsoft Internet Explorer (Programming), versions 3.0, 3.01, 3.02, 4.0, 4.01
  • Microsoft Visual C++, 32-bit Editions, versions 4.2, 4.2b, 5.0

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.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

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.

Steps to Reproduce Behavior

  1. Build the MFC BINDSCRB sample provided with Microsoft Visual C++.

  2. Run the resulting application to register the server and save a Scribble document.

  3. Drag the Scribble document to Internet Explorer to activate the BINDSCRB server and display the Scribble document.

  4. Select Print from the Internet Explorer File menu. The document will be output to the printer, but the view is disabled and will not accept any input.

REFERENCES


Additional query words: DocObject server DocObj Active Document
Keywords : AXSDKIEAutomation MfcOLE AXSDKDocObjects
Technology : kbInetDev kbole
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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 15, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.