Programmer's Haven
« Black-Box redirect? »

Welcome Guest. Please Login or Register.
Dec 27, 2009, 12:00pm




Programmer's Haven :: Other Languages :: Gui4Cli :: Black-Box redirect?
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Black-Box redirect? (Read 72 times)
triola
New Member
*
member is offline





Joined: Oct 2009
Gender: Male
Posts: 6
 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.

Any thought on this?

Thanks,
Tony
« Last Edit: Nov 1, 2009, 4:45pm by triola »Link to Post - Back to Top  IP: Logged
Garrett
Administrator
member is offline

[avatar]

I shall conquor the worl..... Ooooo, pretty blinking LED lights!


[homepage]

Joined: Dec 2006
Gender: Male
Posts: 623
Location: In my mind
 Re: Black-Box redirect?
« Reply #1 on Nov 1, 2009, 4:19pm »

Unfortunately I'm busy with homework today and don't have the time to research this with you. :-( Hopefully someone else will come along with an answer. :-)
Link to Post - Back to Top  IP: Logged

'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

Some software and links: [Parabolic Logic]
My blog, or, My Rants: [MSN Live Spaces]
triola
New Member
*
member is offline





Joined: Oct 2009
Gender: Male
Posts: 6
 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).

Tony

Link to Post - Back to Top  IP: Logged
triola
New Member
*
member is offline





Joined: Oct 2009
Gender: Male
Posts: 6
 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...
Link to Post - Back to Top  IP: Logged
Garrett
Administrator
member is offline

[avatar]

I shall conquor the worl..... Ooooo, pretty blinking LED lights!


[homepage]

Joined: Dec 2006
Gender: Male
Posts: 623
Location: In my mind
 Re: Black-Box redirect?
« Reply #4 on Nov 4, 2009, 11:38am »

:-)
Link to Post - Back to Top  IP: Logged

'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)

Some software and links: [Parabolic Logic]
My blog, or, My Rants: [MSN Live Spaces]
   [Search This Thread][Send Topic To Friend] [Print]

Google
Webcodecraft.proboards.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!