Solved

how to code a print function in borland C++

Posted on 2000-02-29
2
541 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
[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 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

617 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