?
Solved

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

Posted on 1998-06-28
4
Medium Priority
?
418 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Curious about the latest ransomware attack? Check out our timeline of events surrounding the spread of this new virus along with tips on how to mitigate the damage.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 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