delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/14/13:03:35

Message-ID: <19980114175633.19988.qmail@hotmail.com>
From: "John Patton" <gimli21 AT hotmail DOT com>
To: dream_acres AT compuserve DOT com
Cc: djgpp AT delorie DOT com
Subject: Re: Printing
Date: Wed, 14 Jan 1998 09:56:33 PST

>Could someone help with with showing me how to do some somple printing
>ruitines?  I would assume that use bios_print(), but I am not sure, or 
is
>there an easier way to redirect stdout to the printer or buffer 
temporarily
>so I can do something like cout << data; and have it go to the
>printer/buffer?
>
>The printing I am trying to do is a simple text only type printing, so 
I
>don't need any special formatting.
>
>
>Thanks,
>
>Joe Davidson
>

If your familiar with fstream classes and the derived
fstream classes:

//file: mytest.cc
#include <fstream.h>

int main()
{
    ofstream pout("LPT1");
    pout << "Test\n";
    return 0;
}


NOTE: the page is printed out right away because 
the ofstream object is destroyed clearing the
printer buffer...  You need to manually send a 
form feed to make this happen in your program.

I'm not 100% on all the details, but that's my 
take on it.

HTH,

Johnny P.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019