Results 1 to 1 of 1

Thread: Console application I/O redirection. (edited the post on 01-20-2005)

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    Console application I/O redirection. (edited the post on 01-20-2005)

    Based on information and examples I found on the internet (and these forums) I wrote a program that should redirect the output from a console program to a Visual Basic program and recieve its input from that Visual Basic program.

    The console program is launched by using the CreateProcess function so that the stdinput and stdoutput handles for the console program can be set. The I/O is sent through a pipe created by the CreatePipe function. The ReadFile and WriteFile API functions are used to read or write the I/O.

    So far I only managed to get it to work partially at best. Whenever I try to get the output only, it gets the first bit of output. When I try to check for output again, my program freezes up. When I try to send input the program always freezes instantly when started.

    Can any one tell me what I am doing wrong or point me to information involving console I/O redirection? Preferably information about how to do this in Visual Basic not in C++ or something.

    The program I wrote is attached to this message.

    BTW: I am using Visual Basic 5.0 professional and don't have Visual Basic.net which from what I have heard has better support for console programs.
    Last edited by Peter Swinkels; Jan 20th, 2005 at 03:29 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width