473,396 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to send output to a local printer

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;
Jul 22 '05 #1
1 4363

"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
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
3
by: carlor | last post by:
Hi there, Our client has a requirement to print labels from the web site to a local printer. i.e. user logs onto web site and click a print button and the address is printed to a label printer...
13
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access. It works just fine if I hard code the actual...
1
by: Hector M Banda | last post by:
Hi all, Need advice on how to send output to a tiket printer using VB2005. I cannot figure out how to send scape sequences to change fonts, etc. I am using a generic printer driver but no luck....
1
by: rsaikamesh | last post by:
Hi, I have connected RFID printer(Zebra R2844-Z) to serial port(dev/ttyS0). My OS is linux(ubuntu). I am using minicom for communication. I need to print some data using the RFID printer. the...
0
by: ic3s | last post by:
I need help in completing my program that sends files using java. What I wanted, instead of putting the text in a string then send, I want to save it to file in my local drive and the program would...
1
by: remya1000 | last post by:
how to send a .txt file to a printer. after creating a .txt file i need to send that .txt file to a printer.using vb.net and while sending that file to printer i need to tell, which printer i need...
0
by: Jorgen Bodde | last post by:
Hi, It depends on how your printer can be accessed. Is there a driver for it? The most simple way might be using ShellExecute (under windows) but I found no way to supress the print dialog. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.