How to send command to console application from GUI application

后端 未结 3 632
半阙折子戏
半阙折子戏 2020-12-05 21:13

I have a console application that I launch from a GUI applicaiton. The console application takes parameters for filenames to parse and process. Currently I am able to captur

3条回答
  •  情歌与酒
    2020-12-05 21:16

    Check this out to see that you need to create both pipes (by calling the WINAPI twice) as reiterated by Nat but what about the inheritable handles - not sure why this is needed?

    http://support.microsoft.com/kb/190351.

    I think what might also be confusing is that when you create a pipe you are creating a read handle and a write handle for that pipe. In the case of the console's stdin pipe you will only use the write handle. Then you create another pipe for the console's stdout (which will also have a read and write handle) but you will only use the read handle.

    I believe I have that correct but it is late and I'm going to bed.

提交回复
热议问题