Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Output from screen to printer

Output from screen to printer

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BRIMID
    wrote on last edited by
    #1

    Hello, I have written a C++ program. I have compiled,built and executed the program. It works fine. I want to be able to send the output on the screen to a printer. How can I nclude this option. Can I use MFC? In other words how do I display my program on a page that contains the options for print view, print,save etc. Thank You

    D M P 4 Replies Last reply
    0
    • B BRIMID

      Hello, I have written a C++ program. I have compiled,built and executed the program. It works fine. I want to be able to send the output on the screen to a printer. How can I nclude this option. Can I use MFC? In other words how do I display my program on a page that contains the options for print view, print,save etc. Thank You

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Have you considered:

      FILE *pOutput = fopen("LPT1:", "w");
      fprintf(pOutput , ...);
      fclose(pOutput);


      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      1 Reply Last reply
      0
      • B BRIMID

        Hello, I have written a C++ program. I have compiled,built and executed the program. It works fine. I want to be able to send the output on the screen to a printer. How can I nclude this option. Can I use MFC? In other words how do I display my program on a page that contains the options for print view, print,save etc. Thank You

        M Offline
        M Offline
        Mike Danberg
        wrote on last edited by
        #3

        First off I have seen you post this at least 4 times. Yet, everyone who responds seems to be thinking like a rocket scientest. For anyone who reads this, all he wants to do is provide printing options for his program. i.e. File ... Print. It's a simple concept. From what I've read over the last week or so, he has a console application that does a bunch of stuff and displays it on the screen in the console. All that he wants to do is print what's in the console. So anyone that knows a simple way of printing from the console, post it, so we don't have to continue reading the same post. Brimid, I told you before, go to the printing section of this site and read some of the articles. I'll even point a few out to you in a few mins. I don't know what to tell you about using MFC, because its not something you can just jump right into and understand. It takes time. But I'll go find a few articles for you to look at anyway.

        1 Reply Last reply
        0
        • B BRIMID

          Hello, I have written a C++ program. I have compiled,built and executed the program. It works fine. I want to be able to send the output on the screen to a printer. How can I nclude this option. Can I use MFC? In other words how do I display my program on a page that contains the options for print view, print,save etc. Thank You

          M Offline
          M Offline
          Mike Danberg
          wrote on last edited by
          #4

          Here's some links. http://www.codeproject.com/printing/printing_wo_docview.asp[^] This is an article showing some generic printing functions. It's what I used to learn how to print. It uses MFC however. If your program isn't real big I might be able to help you out. http://www.codeproject.com/printing/printingtricksandtips.asp[^] There's some good tips in this article. http://www.codeproject.com/printing/printmechanism.asp[^] This article might help, haven't really looked at it much though. Again all of these use MFC and if your program isn't too big, maybe I can help you out with it.

          1 Reply Last reply
          0
          • B BRIMID

            Hello, I have written a C++ program. I have compiled,built and executed the program. It works fine. I want to be able to send the output on the screen to a printer. How can I nclude this option. Can I use MFC? In other words how do I display my program on a page that contains the options for print view, print,save etc. Thank You

            P Offline
            P Offline
            PJ Arends
            wrote on last edited by
            #5

            #include <fstream>

            int main(int, char*)
            {
            ofstream Printer ("lpt1:");
            Printer << "Test" << endl;
            return 0;
            }

            Works if the printer is connected to your parallel port, not sure about USB printers.


            "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups