🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8622

Re: Printing to LPT1

#8622
From: mike
Date: Sat, 09 Oct 2004 20:52
34 lines
1670 bytes
Thanks for answering Bob.

Tried all and it still won't send anything to the printer. Any other
suggestions.

Mike

"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:am6gm0hctvodhsq42uao3mj83eb8vncknh@4ax.com...
> mike wrote:
>
> >I am wondering if someone could tell me why this code does not send
anything
> >to the printer I have attached to the lpt1 port.
> >
> >char buff[100];
> >
> >strcpy(buff,"Test");
> >
> >    FILE *ptr = fopen("LPT1","w");
>
> Open it in Binary mode  "wb"
> IIRC, in the DOS days, the port was "LPT1:"
> If the other changes don't fix it, try that.
>
> >fprintf(ptr,buff);
> >fclose(ptr);
>
> Some printers won't print partial lines.
> Add
> fprintf(ptr,"\r\n");
>
>
>
Technical Details
Message-ID: <41685010$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41673a45$1@newsgroups.borland.com> <am6gm0hctvodhsq42uao3mj83eb8vncknh@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,facf9d1b2fa86ea6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "mike" <mfbrowne@earthlink.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41673a45$1@newsgroups.borland.com> <am6gm0hctvodhsq42uao3mj83eb8vncknh@4ax.com>
Subject: Re: Printing to LPT1
Date: Sat, 9 Oct 2004 16:52:46 -0400
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 68.204.191.80
Message-ID: <41685010$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097355280 68.204.191.80 (9 Oct 2004 13:54:40 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail