delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/01/18:42:16

From: kagel AT quasar DOT bloomberg DOT com
Date: Wed, 1 May 1996 18:36:00 -0400
Message-Id: <9605012236.AA05011@quasar.bloomberg.com >
To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.960421181551.15447D-100000@is> (message from Eli Zaretskii on Sun, 21 Apr 1996 18:27:40 +0200 (IST))
Subject: Re: Help writing to the printer
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   Date: Sun, 21 Apr 1996 18:27:40 +0200 (IST)
   From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>

   On Fri, 19 Apr 1996 kagel AT quasar DOT bloomberg DOT com wrote:

   > had with piped output, but, it did not.  I am trying to write to the default
   > DOS printer (PRN, LPT1) and cannot.  The app's output goes to the DJGPP temp
   > directory and never prints.  Anyone have a solution?  Anyone try this?  I'll

   There is a bug in the DJGPP v2 library: it defines `stdprn' as using file 
   handle 3 and `stdaux' as using handle 4, whereas it should be the other 
   way around.  So when you fprintf to stdprn, it actually tries to write to 
   the COM1 port, with the obvious results.

   To correct this, compile the files `stdprn.c' and `stdaux.c' below and 
   put them into your C library, like this:

	   gcc -Wall -O3 -c stdprn.c
	   gcc -Wall -O3 -c stdaux.c
	   ar rvs c:/djgpp/lib/libc.a stdprn.o stdaux.o
	   ranlib c:/djgpp/lib/libc.a

   and print happily ever after by writing to stdprn.

   > In my Borland and other 16bit versions I just wrote to stdprn or opened 
   > a file named "PRN" and voila!  Neither solution seems to work.

   Opening "PRN" or "LPT1" works for me.  For instance the following program 
   really prints:

Thanks Eli.  I'll try this soonest and feed back.  

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


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