|
-
Jul 26th, 2005, 11:27 AM
#1
Thread Starter
Junior Member
Using StandardInput property of Process
I've been working on an application that acts as kind of a wrapper around a console executable. What I'm intending is that I can pass commands to a console app and receive the output from those commands. Now, so far I've been able to do all the basic stuff. I created an application that creates a new process and a couple of threads to listen to the standardout and standarderr streams and it returns the output from cmd.exe without much trouble. The catch is that I was creating a new process and threads for each command and using the "/C" switch to kill cmd.exe after it ran the command.
The next step for me was to create a new class that encapsulated that functionality and that I could queue up commands in and have them executed one at a time. The problem that I seem to be having is that when I redirect the standardinput and pass a value using "myprocess.standardingput.writeline(cmd)", it doesn't seem to do anything.
My threads never raise an event and the app just sits there. I'm not sure exactly what I'm doing wrong. I'm very new to multithreading though, and although I got it working in my last revision, it's quite possible that I could be making a mistake in that area. Or it could be something else altogether. I can post code if it will help, although there's a fair amount of it. Any help anyone can offer would be appreciated. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|