HOWTO: Print From an Active Document Server

Last reviewed: January 30, 1998
Article ID: Q180152
The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, version 5.0

SUMMARY

This article explains how to print from an Active Document (DocObject) server while the server is in-place activated in an Active Document container.

MORE INFORMATION

An Active Document server provides a mechanism for viewing the contents of a document within a single container, such as Microsoft Internet Explorer or Microsoft Office Binder. Active documents are displayed in the entire client area of the container, are involved in menu merging, and are always in-place active.

Microsoft Visual C++ provides an AppWizard that can help you create an Active Document server implemented using the Microsoft Foundation Classes (MFC).

When an Active document is in-place activated, a user may want to print the contents of the document using the Print menu item available on the container File menu. To provide this functionality in an MFC Active document server, perform the following steps:

  1. Declare an OLE command map in the declaration file for your COleServerDoc-derived class as follows:

          class CMyOleServerDoc : public COleServerDoc
          {
    
             ...
          protected:
             DECLARE_OLECMD_MAP()
          };
    
    

  2. Implement the OLE command map in the implementation file for your COleServerDoc-derived class as follows:

          BEGIN_OLECMD_MAP(CMyOleServerDoc, COleServerDoc)
    
             ON_OLECMD_PRINT()    // Implements OLE printing
          END_OLECMD_MAP()
    
    

REFERENCES

"Inside OLE" by Kraig Brockschmidt, published by Microsoft Press. "Understanding ActiveX and OLE" by David Chappell, published by Microsoft Press.


Additional query words: print ON_OLECMD_PRINT Active document DocObj
Keywords : AXSDKDocObjects
Technology : internet ole kbinetdev
Version : WINNT:5.0
Platform : winnt
Issue type : kbhowto


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: January 30, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.