Author: Tim Foden
Date: 13:32:47 04/05/02
Go up one level in this thread
On April 05, 2002 at 15:09:32, Roy Eassa wrote: >On April 05, 2002 at 14:58:14, Tim Foden wrote: > >>On April 05, 2002 at 13:58:17, Roy Eassa wrote: >> >>>I understand that it reads stdin. I was wondering if there was a way for >>>another app to "send" something that, to Chest, looked like it was coming from >>>stdin. This question is aimed at those who are experienced with programming >>>tricks in Windows and/or DOS. >> >>Yes it is possible. Under Win32 you follow the following procedure. >> >>1. Save your current processes stdin, stdout and stderr. >>2. Replace your stdin, stdout and stderr with pipes. >>3. Create the child process, inheriting handles. >>4. Restore your saved stdin, stdout and stderr. >>5. Communicate with the child process using your end of the pipes. >> >>Cheers, Tim. >> > >Tim, thank you. > >I should have been more explicit. My app, over which I DO have control, needs >to talk to an _existing_ DOS app, which I must treat as a "black box". (The >latter is not a child process.) Under these strict conditions, is this still >possible? Now you've confused me! :) I know chest is a command line program (I guess this is what you mean by a DOS app.) The normal way to talk to such a program using its stdin/stdout/stderr is to start the program (Chest) from your application, while at the same time setting up its stdXXX to be pipes from within your application. You do this by starting Chest as a child process of your application. You seem to imply in your reply that Chest is already running, and you want to attach to it. Is there some reason why you cannot start Chest from within your application (this doesn't mean that Chest is part of your application, just that your application causes Chest to run.) >Additional info: > >I can write my app in VB or VC++ or something else. The first two I have some >experience with; the something else I will need to learn. However, I've >downloaded Tcl/Tk and will try to learn it because then what I do could >presumably work on other platforms. I'm afraid really don't know much about Tcl/Tk, but I would assume it also has some method of starting another application, with pipes for stdXXX. Anyone else have a comment about this? Cheers, Tim.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.