Writing direct to printer
- Posted by "Andy Drummond" <andy at kestreltele.com> Mar 22, 2004
- 358 views
This is a multi-part message in MIME format. ------=_NextPart_000_0094_01C4101B.20925980 charset="iso-8859-1" I have a project whereby I need to write a log file to the printer port as fast as it appears - but Windows only outputs anything when you throw a page. I have tried using the Windows routine WritePrinter() but it needs the handle to the the printer DC, and I can't seem to get that anywhere. I use Win32Lib 59.1 and Judith's IDE to write my code - plus my own DLL to call WritePrinter because that lives in WinSpool.lib and not in a DLL. Does anyone know where I can find the handle of the DC that Win32Lib gets when you call getPrinter() in that library? I have the DC itself, but that doesn't seem to help. I don't think I understand handles...... ------=_NextPart_000_0094_01C4101B.20925980 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1400" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>I have a project whereby I need to write a log file to the printer port</FONT></DIV> <DIV><FONT face=Arial size=2>as fast as it appears - but Windows only outputs anything when you</FONT></DIV> <DIV><FONT face=Arial size=2>throw a page.</FONT></DIV> <DIV><FONT face=Arial size=2>I have tried using the Windows routine WritePrinter() but it needs the</FONT></DIV> <DIV><FONT face=Arial size=2>handle to the the printer DC, and I can't seem to get that anywhere.</FONT></DIV> <DIV><FONT face=Arial size=2>I use Win32Lib 59.1 and Judith's IDE to write my code - plus my own</FONT></DIV> <DIV><FONT face=Arial size=2>DLL to call WritePrinter because that lives in WinSpool.lib and not in</FONT></DIV> <DIV><FONT face=Arial size=2>a DLL.</FONT></DIV> <DIV><FONT face=Arial size=2>Does anyone know where I can find the handle of the DC that Win32Lib</FONT></DIV> <DIV><FONT face=Arial size=2>gets when you call getPrinter() in that library? I have the DC itself, but</FONT></DIV> <DIV><FONT face=Arial size=2>that doesn't seem to help. I don't think I understand handles......</FONT></DIV> ------=_NextPart_000_0094_01C4101B.20925980--