Connecting Tech Pros Worldwide Help | Site Map

How to send output to a local printer

Richard Johnson
Guest
 
Posts: n/a
#1: Jul 22 '05
I am a C++ newbie and am trying to send simple text data to my local
printer. My printer is a USB printer and I have tried the following code
using my USB port. This code executes but does not send anything to the
printer. I have checked my printer ports and the name I have in the code is
the same as is listed on the printer port.The code is as follows:
file.open("USB-Compaq_A3000");
file << "Hello World" << std::endl;
file.close;


John Harrison
Guest
 
Posts: n/a
#2: Jul 22 '05

re: How to send output to a local printer



"Richard Johnson" <rjohnson383@mchsi.com> wrote in message
news:BR10c.424345$xy6.2459350@attbi_s02...[color=blue]
> I am a C++ newbie and am trying to send simple text data to my local
> printer. My printer is a USB printer and I have tried the following code
> using my USB port. This code executes but does not send anything to the
> printer. I have checked my printer ports and the name I have in the code[/color]
is[color=blue]
> the same as is listed on the printer port.The code is as follows:
> file.open("USB-Compaq_A3000");
> file << "Hello World" << std::endl;
> file.close;
>[/color]

There is no standard way in C++ to access a printer. In any case these days
printers a sophisticated beasts and are unlikely to accept simple text
output, as you are attempting.

You need to ask this question on a group dedicated to programming whatever
operating system you are using, since it is via the operating system that
you access the printer. Have a look here for suggestions and general advice
on posting to comp.lang.c++.

http://www.slack.net/~shiva/welcome.txt

john


Closed Thread