🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Using Windows printer with standard iostreams

#15846
From: Nick B. Cassos
Date: Mon, 09 Jun 2003 18:28
26 lines
2174 bytes
On Mon, 09 Jun 2003 17:15:48 +0100, Alisdair Meredith
<alisdair.meredith@uk.renaultf1.com> wrote:

>Just checking, but does anyone know how library / easy way to use the
>printer in Windows as a simple line printer using std streams?  [i.e.
>write to printer as if to std::cout]
>
I use CreateFile()/WriteFile() for years in all Windows versions,
without problem on all printer types (dot-matrix, lasers, inkjets).
The same should be valid using streams. 

For local printers, you can specify LPTx or COMx as the filename. For
network printers you can specify the "\\Server\Share" syntax. For this
to be valid, a share has to be made in the "Server", but, the nice
thing is that it is irrelevant what printer driver there is actually
installed. For example, in one of my installations I use a SiteCom
rooter/printer server combo - connected to a laser and a switch hub -
which is accessed from all computers indirectly through a TTY shared
driver installed in the fileserver. In my app, I enter
"\\Server\Generic" as the path and all invoices find their way out to
the printer server. 

-- 

Nick B. Cassos
http://www.flenik.com
Technical Details
Message-ID: <cmj9ev0bqfmeo0tst2huh4d1n3bgfkvsmv@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3EE4B2B4.DE5AB2AA@uk.renaultf1.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a2c54bfae5b2c76c
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-09 12:11:52 PST
From: Nick B. Cassos <nbc@no_spam.ath.forthnet.gr>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Using Windows printer with standard iostreams
Date: Mon, 09 Jun 2003 21:28:39 +0300
Message-ID: <cmj9ev0bqfmeo0tst2huh4d1n3bgfkvsmv@4ax.com>
References: <3EE4B2B4.DE5AB2AA@uk.renaultf1.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.16.151.17
X-Trace: newsgroups.borland.com 1055183327 213.16.151.17 (9 Jun 2003 11:28:47 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail