Solved

how to code a print function in borland C++

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

734 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