MSDN Archive Home
Help and FAQs
Printing from Native Windows Programs
All Resource Updates
Change History (all pages)
These sample programs demonstrate how to print from a native Windows program.
is a native Windows program that creates an XPS document and sends it to a printer. In this sample, the print processing is performed in a separate thread so as to not block the user interface.
The purpose of this sample is to illustrate, at a relatively low level, how to implement the printing functions in a native Windows program. While this sample program is written in C++, it does not use object oriented programming techniques. The goal is to illustrate the functions with as little abstraction as possible. Object-oriented programmers can apply the concepts that are illustrated in this sample program to their own object framework.
is a native Windows program that uses the GDI Print API to print from the application. It is essentially the same program as
described above; however, this program has had the XPS Print API functions replaced by the corresponding functions of the GDI Print API. Wherever possible, new and updated Windows programs should print by using the XPS Print API.
Sep 24 2010 at 7:08 PM
, version 9
Nov 30 2010 at 11:25 PM
The code compile only if the missing include is commented, also when running it nothing is actualy being printed, instead it produces a xps file? So not sure what this exmaple is meant for. Thanks
Sign in to add a comment
Print Sample Program -...
Mon Jun 28 2010 at 7:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.