Article View: borland.public.cppbuilder.nativeapi
Article #8624Re: Printing to LPT1
From: mike
Date: Sun, 10 Oct 2004 13:57
Date: Sun, 10 Oct 2004 13:57
54 lines
2443 bytes
2443 bytes
Well it dosen't make any difference weather I try opening the printer port
as "lpt1:" or "prn", I still don't get anything sent to the printer.
So I am still at a loss as to why this does not work.
Mike
"Farmazon" <farmazon_1@mail.ru> wrote in message
news:41686651@newsgroups.borland.com...
>
> "mike" <mfbrowne@earthlink.net> �������/�������� � �������� ���������:
> news:41685010$1@newsgroups.borland.com...
> > 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");
> > >
> > >
> > >
> >
> >
> it becose you open file on disk. .If you want send data to printer use
name
> "lpt1:" or "prn:".
>
>
Technical Details
Message-ID:
<41694039$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41673a45$1@newsgroups.borland.com> <am6gm0hctvodhsq42uao3mj83eb8vncknh@4ax.com> <41685010$1@newsgroups.borland.com> <41686651@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,facf9d1b2fa86ea6 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII From: "mike" <mfbrowne@earthlink.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <41673a45$1@newsgroups.borland.com> <am6gm0hctvodhsq42uao3mj83eb8vncknh@4ax.com> <41685010$1@newsgroups.borland.com> <41686651@newsgroups.borland.com> Subject: Re: Printing to LPT1 Date: Sun, 10 Oct 2004 09:57:33 -0400 Lines: 56 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: <41694039$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1097416761 68.204.191.80 (10 Oct 2004 06:59:21 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail