Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Piping console output from c executable to VB6 textbox

Status
Not open for further replies.

Yorkshireman2

Programmer
Jan 21, 2005
154
CA
I have a VB 6 form with a button which calls a procedure to start an exe in a subdirectory of the VB6 App.
I tried code fro mhere: which "creates a pipe and executes the console application, telling it to send output and error information to the pipe. It then reads from the pipe until there's no output left to read."

It runs my executable ok but my destination text box does not update line by line, as the original console execution does.
The VB form sort of goes partially blank- not refreshing- until the called executable finishes-then the text box fills with all the text from the pipe.
Does anyone know if this all I can get or should it output line by line as the executable prints each line??
 
>should it output line by line as the executable prints each line??

No, afraid not, not as written. It is related to the fact that you are doing a synchronous file read, and also that win32 doesn't do pipes quite like Unix does.
 
Thanks Dilettante (and Strongm),

I will examine that example and see.

 
Hi Strngm, I took a first look and ran it as described but I don't yet understand it enough to be able to use the code in my app.
I don't get much time to spend on this app so I must wait until I can really study it.
Once I get the idea I will try to add the parts I need to make my app work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top