Generic Viewer/Printing Application for Windows Files

Environment: Visual C++ 5 (SP1), Windows 95 (SP2), Windows 98 (SP1)

This is a simple SDI application that allows to view and print the "usual" Windows files from MFC, such as HTML, TXT, DOC, XLS, PDF, PPT and so forth, provided that you already have defined an association for each file type on your system. It is based on previous CodeGuru articles ('Using HtmlView apart from Tecno Preview' by Iuri Apollonio and 'Printing Web Pages like Internet Explorer' by Sriram Srinivasan.

All I have done is to add printing capabilities (and a shortcut, regarding text files -see below) to Apollonio's CHView class, and derived my CView from said class, and it works!

The source sample is a bare bones SDI application, on which I have added the modified CHView class, GFXEXDISP.H header and the UUID.LIB library.

Note that text files cause a slight complication, since they are not readily accessible from the browser, and the browser object does not support the usual text editors. Hence, and since I badly needed a generic viewer/printing app in a hurry, just wrote a couple of routines for performing a "brute force" translation of text to HTML on a temporary file. I know that there are many solutions far better than mine, but... at least it works.

Downloads

Download source - 112 Kb


Comments

  • Cool stuff

    Posted by Legacy on 03/27/2003 12:00am

    Originally posted by: Daniel Balla

    the best I found. and I searched a while ...

    Reply
  • how to get image of printer driver

    Posted by Legacy on 01/21/2003 12:00am

    Originally posted by: summer

    at work,i meet a trouble,i want to get contents of printer
    before printing.how do i get them,hope somebody can help me

    • f

      Posted by hagyo79 on 06/17/2008 09:12am

      f

      Reply
    • hi

      Posted by cdh1979 on 10/01/2007 05:23am

      thank you..

      Reply
    Reply
  • uuid.lib isn't correct in the package, use MSVC's instead

    Posted by Legacy on 04/25/2001 12:00am

    Originally posted by: Valerio

    uuid.lib isn't correct in the package, use MSVC's instead

    Reply
  • Link error in w2k, VC6 sp5

    Posted by Legacy on 03/16/2001 12:00am

    Originally posted by: Choi Young Dae

    Hi
    How to compile and linking.
    My Environment : Windows2000pro-sp1, VC6-sp5

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds