?
Solved

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

Posted on 1998-06-28
4
Medium Priority
?
415 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Expert Comment

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

Accepted Solution

by:
nietod earned 120 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
Suggested Courses

741 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