Solved

how to code a print function in borland C++

Posted on 2000-02-29
2
535 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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now