Hi Guys,
Is there anybody, who can tell me how I can simulate the DOS Command:
Copy filename LPT1
in C++ ?
I have tryed it with the READFILE and WRITEPRINTER commands, but i#ll
get only chunk on the paper.
thanks for any comment
M. Vogler 4 2315
> Hi Guys, Is there anybody, who can tell me how I can simulate the DOS Command: Copy filename LPT1 in C++ ? I have tryed it with the READFILE and WRITEPRINTER commands, but i#ll get only chunk on the paper. thanks for any comment M. Vogler
If you want to invoke the DOS shell I think you will need the "system" call.
I don't know about 'simulating' it, but I think that is off topic here
anyway since it involves dos API (if you can speak of that ;) ) calls that
do not have anything to do with C++ itself.
HTH, Jaap
Martin Vogler wrote: Hi Guys, Is there anybody, who can tell me how I can simulate the DOS Command: Copy filename LPT1 in C++ ?
#include <fstream>
int main()
{
std::ifstream file("filename");
std::ofstream lpt("LPT1");
char c;
while (file.get(c) && lpt.put(c));
}
It will probably be more efficient if you don't copy each character on its
own, but instead read/write in blocks.
Rolf Magnus schrieb: Martin Vogler wrote:
Hi Guys, Is there anybody, who can tell me how I can simulate the DOS Command: Copy filename LPT1 in C++ ?
#include <fstream>
int main() { std::ifstream file("filename"); std::ofstream lpt("LPT1"); char c; while (file.get(c) && lpt.put(c)); }
It will probably be more efficient if you don't copy each character on its own, but instead read/write in blocks.
Thanks Rolf for the code, but it doesn't work and I don't know why. I
think I'm to silly to code the problem correctly.
I tried it with two files and it worked but with file and printer
nada:-((( Maybe there is another reason, i code on a laptop without a
parallell port.
Greetings Martin
Rolf Magnus schrieb: Martin Vogler wrote:
Hi Guys, Is there anybody, who can tell me how I can simulate the DOS Command: Copy filename LPT1 in C++ ?
#include <fstream>
int main() { std::ifstream file("filename"); std::ofstream lpt("LPT1"); char c; while (file.get(c) && lpt.put(c)); }
It will probably be more efficient if you don't copy each character on its own, but instead read/write in blocks.
Rolf Thausend Thanks, now it works pretty good. I've only to tell LPT1
which netprinter I want:
net use LPT1 \\server\printername. In Austria we will say now: "runs
like a bell" :-))
Martin This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Karlheinz Klingbeil |
last post by:
I have deonwloaded and tested reportlab, which seems to be good enough for
my needs with printing reports, formatted text and such things.
But i have a question:
I have not seen any hint in...
|
by: Marc Champagne |
last post by:
Hi folks,
I wish to print on pre-printed continuous forms on a dot
matrix printer.
My initial intent was to access to printer directly (in raw
mode, somehow) in order to send whatever is...
|
by: Tom |
last post by:
I am converting an old application that was printing directly to a
specialized printer device (i.e. a special label printer). It was doing this
by opening a file with the file path of 'LPT1:' and...
|
by: notregister |
last post by:
ref : article ID 298141
Hi i have implement this part into my program, how do i recieve information
whether the printer has printed out correctly so that i can carry on to my
next phase?
is...
|
by: E.T. Grey |
last post by:
Hi,
I have an interesting problem. I have a (LARGE) set of historical data
that I want to keep on a central server, as several separate files. I
want a client process to be able to request the...
|
by: Mike9900 |
last post by:
We are developing a point of sale software and need to work with receipt
printers. We need to send texts to the printer directly in desired fonts. We
are able to send texts to the printer using...
|
by: --[zainy]-- |
last post by:
AA Guyz i am using C#.Net 2003 for my project. I want to print report
directly to printer. Keep in mind that i am getting report criteria
from form and viewing report in crystal report viewer.....
|
by: alpnz |
last post by:
Hi,
I am involved with a labelling application, which at the moment prints labels on thermal printers, via the windows driver. This can be frustratingly slow. Most thermal printers have an ASCII...
|
by: Antoon Pardon |
last post by:
On 2008-09-16, Graham Jenkins <graham@vpac.orgwrote:
What about systems that don't use cups for printing?
--
Antoon Pardon
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
|
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |