• CreateProcess and redirected input - how to "pass thru" ?

    From R.Wieser@21:1/5 to All on Sat Apr 20 10:01:03 2024
    Hello all,

    I've written a "launcher" program which uses CreateProcess to start the
    child. Both are console programs.

    The thing is, the child (lets say its "more") accepts redirected input and
    I've got no idea how to get the redirected input from the launcher to the child.

    I've tried a few things (inheriting StdIO handles), but cannot seem to get
    it to work, nor does googeling turn anything up. :-(


    So, the question : how do I allow the child to, if present, use the
    redirected input the launcher gets.

    Remark: this is *not* about the launcher talking to the child using pipes. Examples about that are plenty. If the launcher gets cut off from StdInp
    its fine by me.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Sat Apr 20 15:30:21 2024
    So, the question : how do I allow the child to, if present, use
    the redirected input the launcher gets.

    As it turns out (after having tried throwing all kinds of stuff at it),
    letting the child inherit the launchers StdIO handles isn't the problem.

    What is is that I've put that launcher into the registry as the "open" verb
    for a certain file extension.

    IOW, running it from the comandline works, running it by double-clicking the involved file fails.

    I think I'm outof my depth her ...

    Remark: I've also tried to add OleInitialize (just a hunch), but that didn't make any difference. :-\

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Sun Apr 21 19:25:27 2024
    What is is that I've put that launcher into the registry as the "open"
    verb for a certain file extension.

    (going thru the registry:)

    I checked if the launcher itself could read redirected input from StdIn, and
    it couldn't.

    I removed the launcher altogether, and I got the same problem : and invalid handle.

    FYI, the called (origional) program in case is cscript (for which I added a ".VBC" extension), and the "invalid handle" error is thrown by the script
    that is run.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)