"Richard Johnson" <rj*********@mchsi.com> wrote in message
news:BR10c.424345$xy6.2459350@attbi_s02...
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;
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