delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/16/12:37:17

Message-ID: <36C95237.C81A112D@cbhc.ns.ca>
From: David Nugent <davidn AT cbhc DOT ns DOT ca>
X-Mailer: Mozilla 4.04 [en] (WinNT; U)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Help with sending a file to a printer.
X-Corel-MessageType: EMail
Lines: 32
Date: Tue, 16 Feb 1999 11:10:47 +0000
NNTP-Posting-Host: 142.176.79.34
X-Trace: sapphire.mtt.net 919185065 142.176.79.34 (Tue, 16 Feb 1999 13:11:05 ADT)
NNTP-Posting-Date: Tue, 16 Feb 1999 13:11:05 ADT
Organization: Business Internet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Anyone have any ideas why this doesn't work properly:

I have a file called TEST.PRN  I created it by printing to
a file (through Windows), instead of to the LPT1:
port.

If I go to DOS and type

COPY /B TEST.PRN LPT1:  (/B is for Binary)

It prints perfect.  If I try however

//////////////////////////////
#include "stdio.h"
main()
{
FILE *in;
int c;
in=fopen("TEST.PRN","rb");
while((c=fgetc(in))!=EOF)  fputc(c,stdprn);
fclose(in);
exit(0);
}
//////////////////////////////

This sends the file to my printer, but it seems all
garbled?? Any idea why this doesn't work right?

Appreciate any information.
Thanks!
Dave Nugent

- Raw text -


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