Black-Box redirect? « Thread Started on Nov 1, 2009, 4:01pm »
OK, I have another question, and it would seem this one might get asked a lot:
Does GUI4Cli have a native method to grab output from a cmd-line process?
I want to redirect ffmpeg's output to a text-box, edit-box, or listview, since that's the CL app I'm writting the gui for.
I tried following the example Chris K included with the DOS DLL stuff, but couldn't get it to do anything (either bad or good).
A possible problem with ffmpeg is that it writes to stderr instead of stdout, but I can pass a redirect from the command line to change it's behavior (hopefully).
For as long as this stuff has been around, you'd think there would be a non-proprietary way of getting output into some kind of text-box on a GUI, so I'm just asking before wading through DDE, PIPES, COPYDATA, etc.
Pipes would be a good way to go, does GUI4Cli have any native support for this sort of thing besides the add-on dos.dll (or is there dos.dll example code to specifically handle ffmeg output, since it's stderr)? ------------------
You know, I can actually grab a stdin stream pretty easily from a little CL app, if I pipe ffmpeg output to my little helper-app, could I then fire an event in my GUI and write the resulting data to one of the controls mentioned above?
This way, the process would be entirely asynchronous, it would remain command-line driven (wouldn't even have to spawn the helper app), just call ffmpeg and append '2>&1 | helper.exe arg1 arg2 ...' to the command-line.
The 'event', window-handle, title, or whatever is necessary could even be passed to the helper-app on the command-line as args.
Re: Black-Box redirect? « Reply #2 on Nov 1, 2009, 4:33pm »
Thanks, Garrett.
There are several ways to get this done, I'm just looking to minimize 'kludge creep' by asking for 'preferred' methodology before 'reinventing' something I don't need to.
It may well be that I haven't utilized dos.dll properly and just need a good 'lesson' before striking out on my own (again).
Re: Black-Box redirect? « Reply #3 on Nov 4, 2009, 10:53am »
I take it all back, dosdll works great!
Again, it was a case of my unfamiliarity with Gui4Cli that hung me up earlier.
I might add that I tried to implement this in a new gui using just the html docs before even running the example, when all else fails, read the directions...