Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How print tekst on parallel printer?

Status
Not open for further replies.

cherno

Programmer
Apr 23, 2005
4
0
0
BE
I've borland c++

have already tryed

openfile "prn" and "lpt1" but they don't work..

can someone pls help me?

thx!

 
Borland C++? Version? Borland C++ Builder?

Totte
Keep making it perfect and it will end up broken.
 
even the fprintf( stdprn,"test/n/r/f" );

shows the text on my screen :s


stupid borland...

is there a code i can execute dos commando's like "print xxx.txt" thx!
 
The standard output in C/C++ is the screen. Show us the code you used to print to lpt1:. That ought to have worked.



James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
that is the problem, it never worked, and i'm despered for a solution..

But maybe i need to make a project on other ways?

now i use "Easy Win(.exe)"
with the options in advanced: .C node, and .rc and .def vinked off..

so i use .c not .cpp maybe that is fault?
 
I do it all the time with the standard template language. The problem is your version pre-dates the STL so it may not work the same.
Code:
std::ofstream OFile; // stream set up
OFile.open("LPT1:", std::ios::app); // open printer for append

if (!OFile)
{
   // Something went wrong
   Application->MessageBox("Could not open file for processing!", "File Error", MB_OK); // might not work in 4.52
}
else
{
    // Print
    OFile << "Printing something!" << std::endl;
}

In version 3 there was a standard printer but that was removed in later versions.


James P. Cottingham
-----------------------------------------
[sup]To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top