Thursday, July 30, 2009

What is a command for getting a hard copy in C using graphics.i.e; DOS mode C?

I have made a project to making to find the bill of a hotel in DOS mode C. I want to add a option to get a hardcopy of a bill. please tell me about the commond and its syntax in brief ?

What is a command for getting a hard copy in C using graphics.i.e; DOS mode C?
DOS mode only supports printing to a Parallel Printer (LPTx).





Try using the fprintf with the stream as "prn" (without quotes). See the online Turbo C++ 3.0 Documentation for the prn stream. It should provide output to a printer.





Again you can use:


biosprint


I am not sure if it works in 32 bit Windows.





FAQ:





biosprint and _bios_print %26lt;BIOS.H%26gt;








Printer I/O using BIOS services directly.





Declaration:


■ int biosprint(int cmd, int abyte, int port);


■ unsigned _bios_printer(int cmd, int port, int abyte);





Remarks:


Both biosprint and _bios_printer use BIOS interrupt 0x17 to perform various


printer functions on the printer identified by port.





Arg. │ What It Is





abyte │ The character to be printed; its value can be 0 to 255.





cmd │ Specifies the printer function to be performed.


│ biosprint│ _bios_printer │ Printer Function


│ 0 │_PRINTER_WRITE │ Prints the character in abyte


│ 1 │_PRINTER_INIT │ Initializes the printer port


│ 2 │_PRINTER_STATUS│ Reads the printer status


│ If cmd = 1 or 2 (_PRINTER_INIT or _PRINTER_STATUS), abyte is


│ ignored.


──────┼───────────────────────────────...


port │ Identifies the printer; 0 = LPT1, 1 = LPT2, etc.





return Value: current printer status, obtained by ORing these bit values together:





Bit│ Value│ Printer Status


═══╪══════╪═════════════════


0 │ 0x01 │ Device time out


3 │ 0x08 │ I/O error


4 │ 0x10 │ Selected


5 │ 0x20 │ Out of paper


6 │ 0x40 │ Acknowledge


7 │ 0x80 │ Not busy
Reply:DOS Command for parallel port printer to print a file:





system("print /d:lpt1 C:/afile.txt");
Reply:Does 'print' help?

hydrangea

No comments:

Post a Comment