Programación General > C/C++
Re: imprimir el autoexet
(1/1)
rsalg:
estoy comenzando a usar archivos y ecesito imprimir el archivo autoexet.bat, pero no se como hacerlo. agradecere su ayuda
JuanK:
Hola, prueba esto:
si usas DJGPP
--- Código: Text --- _doserrno = 0;fprintf (stdprn, "Hello, world!rnf");if (_doserrno == 0x1c) fprintf (stderr, "The printer is out of paper!n"); Ahora si buscas algo más avanzado...
--- Código: Text --- bios printerSyntax#include '<'bios.h'>'unsigned _bios_printer(unsigned cmd, unsigned printer, unsigned data);DescriptionThe bios printer routine uses INT 0x17 to perform printer output services for parallelprinters. The printer argument species the aected printer, where 0 is LPT1, 1 is LPT2,and so on. The cmd argument can be any of the following manifest constants:_PRINTER_INITReset and initialize the specified printer port_PRINTER_STATUSReturn the status of the specied printer port_PRINTER_WRITEPrint the data argument to the specied printer portReturn ValueThe bios printer function returns the value in the AX register after the BIOS interrupt.The high-order byte (AH) of the return value indicates the printer status after the operation,as dened below:Bit Meaning if True0 Printer timed out1 Not used2 Not used3 I/O error4 Printer selected5 Out of paper6 Acknowledge7 Printer not busyAlphabetical List 27Portabilitynot ANSI, not POSIXExamplewhile (*c)_bios_printer(_PRINTER_WRITE, *c++, 0);
Y si todavia quieres más avanzado... tal vez c no sea una buena alternativa, porque tienes 2 opciones:
1-elaborar tu propio driver solicitando la informacion necesaria al fabricante.
2-buscar a ver si de alguna forma por medio de la api de windows puedes cargar la impresora actual, o enviarle parametros....esta me suena más factible, y por mucho.:)
suerte
juank
:lightsabre:
JuanK:
si solo necesitas imrpimir texto, utiliza la primera opcion que te di, no es muy dificil realmente, si tienes alguna duda no dudes en comentarla.
juank
Navegación
Ir a la versión completa