home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!steve
- From: steve@monu6.cc.monash.edu.au (Steve Balogh (+61 3 565 4747))
- Subject: Re: Capturing DOS output?
- Message-ID: <1992Jul24.052054.24347@monu6.cc.monash.edu.au>
- Organization: Monash University, Melbourne, AUSTRALIA
- References: <rcgmm3l.jfh@netcom.com>
- Date: Fri, 24 Jul 1992 05:20:54 GMT
- Lines: 34
-
- In article <rcgmm3l.jfh@netcom.com> jfh@netcom.com (Jack Hamilton) writes:
- >I'd like to run a DOS application from inside a Windows application, and
- >have the output from the DOS program appear in a window controlled by my
- >Windows program.
- >
- >I looked at WinExec, but there's nothing obvious in the documentation. Is
- >there some other way to do it?
- >
- >By the way, I'd like the window to scroll as the DOS program creates more
- >output (which will be to stdout), so redirecting the output to a file and
- >then displaying the file won't do what I want.
- >
- >While I'm asking for the impossible, can I capture stderr separately?
- >
-
- I am doing a similar thing in a program I am writing. The method I use is to
- redirect the stdout of the dos program to a temporary file (preferably on a
- RAM disk) and then open the file on a 1 second WM_TIMER message. Read the file
- until it hits EOF, save the current location within the file, and then close it.
- The next time I open the file, I then seek to the saved location and then read
- till EOF again. I keep repeating this procedure until the displying window is
- closed by the user. The method appears to act like the Unix "tail -f" command.
-
- I don't think this is the best way to achieve this task, but it is the best that
- I have come up with so far. Any better methods would be appreciated. Let me
- know if you find one. :-)
-
- Steve
-
- ----_--_-_-_--_-__-_------_-__---_-___-_----_-____-_-_--__-_--_--___-_-_-_--__-_
- Steve Balogh VK3YMY (Maths G.14) | steve@monu6.cc.monash.edu.au
- Monash University, Clayton Campus | 37 54'38.8"S 145 07'47.1"E ...ICBM
- Wellington Road, Clayton. | +61 3 565 4747 Voice (Office)
- Melbourne, AUSTRALIA. 3168 | +61 3 565 4746 Fax
-