Ethereal-users: RE: [Ethereal-users] win32 printing

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard Urwin <RUrwin@xxxxxxxxxxxxxxx>
Date: Wed, 5 Dec 2001 12:29:42 -0000
OK, so I wrote a windows app that copies stdin to a file and then opens
notepad on it. It still doesn't work. I think you have a bug in the windows
version of printing to a pipe. The SDK documentation of popen says:

"Note   The _popen function returns an invalid file handle, if used in a
Windows program, that will cause the program to hang indefinitely. _popen
works properly in a Console application. To create a Windows application
that redirects input and output, read the section "Creating a Child Process
with Redirected Input and Output" in the Win32 SDK."

It doesn't hang (on NT4 sp6a,) but it does cause print_packets() to return
FALSE, resulting in a "Couldn't run print application" error dialog.

I see two possibilities:
a) read that SDK documentation and implement it properly - probably a
humongeous mess of code, and still requires another application to get the
pipe to the printer.
b) on windows send the printed report to a temporary file and then run the
given application on that file. If the application was "notepad /p" this
would have the required effect.

-- 
Richard Urwin, Software Design Engineer
Ricardo Test Automation
Open House, 3 Watling Drv., Hinckley, UK.
rurwin@xxxxxxxxxxxxxxx 


-----Original Message-----
From: Guy Harris [mailto:guy@xxxxxxxxxx]
Sent: 04 December 2001 00:29
To: neil lehrer
Cc: ethereal-users@xxxxxxxxxxxx
Subject: Re: [Ethereal-users] win32 printing


> how does one configure printing in win32 8.20?

Printing to a printer isn't supported; nobody's written the code to do
that on Windows.  (Well, it might work if your path includes a directory
that contains a command that can read its standard input and print to a
printer, along the lines of UNIX "lpr" or "lp".)

Printing to a file is supported, and appears, in the Windows version, to
generate files with CR/LF at the ends of lines, and Notepad, at least on
W2K SP1, appears to be able to read the files.

_______________________________________________
Ethereal-users mailing list
Ethereal-users@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-users

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp