July 24th, 2012, 12:35 AM
Printing in Console application the DOS way
I am maintaining a very old DOS code. I have translated the code so that it now can also be compiled using VC using console mode. i.e. now it can be compiled to DOS and to WinXP both.
Initially it worked all right. But later when printing is needed (which is seldom used) the code found to be limited to LPT1 / LPT2 due to its DOS origin. LPTn was opened using "fopen" and written to using "fprintf".
Now parallel printers are nowhere to be seen, in fact we have a PC with no parallel port at all. Now I am at a loss to find a way to use non-LPT printers with minimal changes to code (it is a large code, despite the fact that printing is seldom used).
Ideally the new feature should not disturb the old DOS code. That is, old style fopen/fprintf should (as far as possible) remain intact.
Any help / pointer in this regard will be much appreciated.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!