Solved

how to code a print function in borland C++

Posted on 2000-02-29
2
538 Views
Last Modified: 2012-08-13
i have problem coding a printing function, that is to say printing an output from screen to hardcopy through the printer. please give a sample coding. from the Borland C++ help file their is a object oriented print function and it is very complicated.
0
Comment
Question by:jameskang78
2 Comments
 
LVL 2

Expert Comment

by:curri
ID: 2570165
If you are in DOS, you'll have to write to the parallel port (check inport/outport in the Borland help files). If you are in Windows, I have no idea :)

Also, how about sending it to a file and printing with another program ??

In fact, this may even give the users more freedom. You can start the program automatically (check system, or WinExec if you are on windows), passing the file name as an argument.

Hope this helps
0
 

Accepted Solution

by:
c6burns earned 10 total points
ID: 2571116
Alright . . . this is by far the easieat thing you will ever do!

If you're in C++ just open a stream and attach it to the standard printer. (if you know how to use streams)

Printing is exactly the same as writing to a file (as long as it's text). Just write to "stdprn" and it should come out. I learned this way back in the QBasic days!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

828 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