HOWTO: Use Automation to Set the Printer from an MFC ProjectLast reviewed: February 6, 1998Article ID: Q180312 |
The information in this article applies to:
SUMMARYThis article discusses how to use Version 4.2 of the Microsoft Foundation Class (MFC) library installed with Microsoft Visual C++ version 5.0 to automate specifying and setting the printer used with a project. It shows how to use the IDispatch interface of the _Application object from the typelib of the application that you are automating. The example code specifically uses Microsoft Word, but the approach works with any other application where the _Application IDispatch interface has the appropriate member functions. Alternatively, you can use the Windows API library functions to set the printer directly. This article does not discuss this approach.
MORE INFORMATIONYou can copy the code in this article to the message handler function of an event defined in an MFC .cpp file. However, the purpose of the code is to illustrate the process of using the IDispatch interfaces and member functions defined in the Msword8.olb type library. The primary benefit comes from reading and understanding the code so that you can modify the example, or write code from scratch to automate setting the printer.
Steps to Create the Project
Keywords : MfcOLE kbcode kbinterop Technology : kbMFC kbOle Version : win95:5.0; WINNT:5.0 Platform : Win95 winnt Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |