Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to code a print function in borland C++

Posted on 2000-02-29
2
Medium Priority
?
544 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 20 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 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 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.

670 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