Solved

print to different ports(lpt1,lpt2,lpt3....)

Posted on 1998-06-28
4
412 Views
Last Modified: 2013-11-15
Could not find a right place to ask this, so since I a need to do this in c++ , then I ask here....sorry.

I need to send output to different parallel ports for printing. stdprn is mapped to LPT1, how can I print in c++ to LPT2, LPT3, and so on...
0
Comment
Question by:migue
  • 2
4 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1166761
What operating system?
0
 
LVL 22

Accepted Solution

by:
nietod earned 30 total points
ID: 1166762
Just open them like a file.

ofstream LPT2("LPT2");

LPT2 ,<< "This Is a Test" << endl;
0
 

Author Comment

by:migue
ID: 1166763
this solution is for a dos-protected program running on plain dos and any version of windows.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1166764
Then just open the printer port as a file.  You can use an output file stream as  I showed you above.  Or you can use the C file I/O functions (fopen(), fwrite(), fclose()) or you can even use the DOS service interrupts.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why isn't object file created? 6 86
C++ Code Issue 4 37
What program can open a .sig file image? 6 73
Cannot install SkypeSetup.exe 4 38
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question