Article View: borland.public.cppbuilder.nativeapi
Article #8623Re: Printing to LPT1
From: Farmazon
Date: Fri, 08 Oct 2004 22:29
Date: Fri, 08 Oct 2004 22:29
41 lines
2062 bytes
2062 bytes
"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:
<41686651@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.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>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,facf9d1b2fa86ea6 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII From: "Farmazon" <farmazon_1@mail.ru> Newsgroups: borland.public.cppbuilder.nativeapi References: <41673a45$1@newsgroups.borland.com> <am6gm0hctvodhsq42uao3mj83eb8vncknh@4ax.com> <41685010$1@newsgroups.borland.com> Subject: Re: Printing to LPT1 Date: Sat, 9 Oct 2004 01:29:34 +0300 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 212.68.163.210 Message-ID: <41686651@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1097360977 212.68.163.210 (9 Oct 2004 15:29:37 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail