PC Review


Reply
Thread Tools Rate Thread

Creating a Child Process with access to Standard Out, Standard In, and Standard Error

 
 
patrick.ohara@cognex.com
Guest
Posts: n/a
 
      15th Jun 2007
I have look over the Process class in CF v2.0. I understand that I
can set UseShellExecute in ProcessStartInfo false and the created
process will share my console (STDIN, STDOUT, STDERR). This may work,
but what I would like to do is create a child process with its own
console, and with a set of pipes to its console. I looked at using
the Win32 API CreateProcess, on the desktop I could use the handles in
the STARTUPINFO structure. On Windows CE this property is not
supported. Does anyone have an idea of how this could be
accomplished.

Pat O

 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      15th Jun 2007
If you want to set up the standard I/O devices for a new program, what you
do is call SetStdioPathW for each of the standard devices in the launcher
program that you're writing, then call CreateProcess to launch the program
that you want to have use those devices, then you call SetStdioPathW to
reset the original devices in your calling program. SetStdioPathW is
documented in the native code SDK help...

Paul T.

"(E-Mail Removed)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have look over the Process class in CF v2.0. I understand that I
> can set UseShellExecute in ProcessStartInfo false and the created
> process will share my console (STDIN, STDOUT, STDERR). This may work,
> but what I would like to do is create a child process with its own
> console, and with a set of pipes to its console. I looked at using
> the Win32 API CreateProcess, on the desktop I could use the handles in
> the STARTUPINFO structure. On Windows CE this property is not
> supported. Does anyone have an idea of how this could be
> accomplished.
>
> Pat O
>



 
Reply With Quote
 
patrick.ohara@cognex.com
Guest
Posts: n/a
 
      15th Jun 2007
On Jun 15, 11:08 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
> If you want to set up the standard I/O devices for a new program, what you
> do is call SetStdioPathW for each of the standard devices in the launcher
> program that you're writing, then call CreateProcess to launch the program
> that you want to have use those devices, then you call SetStdioPathW to
> reset the original devices in your calling program. SetStdioPathW is
> documented in the native code SDK help...
>
> Paul T.
>


Thanks Paul,
Sometimes we just try to make things too difficult :-). Now the
question is how do I setup a pipe so that I can set the console in the
child process to something the parent will also have access too.

Pat O

 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      15th Jun 2007
You might want to try to find the source for the MS-DOS program from Windows
CE and see what it does when it forks to another program that is being run
from the command line there. I think you want to do the same thing.

Paul T.

"(E-Mail Removed)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Jun 15, 11:08 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
> no instrument no spam DOT com> wrote:
>> If you want to set up the standard I/O devices for a new program, what
>> you
>> do is call SetStdioPathW for each of the standard devices in the launcher
>> program that you're writing, then call CreateProcess to launch the
>> program
>> that you want to have use those devices, then you call SetStdioPathW to
>> reset the original devices in your calling program. SetStdioPathW is
>> documented in the native code SDK help...
>>
>> Paul T.
>>

>
> Thanks Paul,
> Sometimes we just try to make things too difficult :-). Now the
> question is how do I setup a pipe so that I can set the console in the
> child process to something the parent will also have access too.
>
> Pat O
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Standard User Files Write access - Standard practice Usman Windows Vista Security 0 3rd Apr 2009 07:01 PM
Reading from a child process's standard error Nicola Musatti Microsoft C# .NET 7 1st Dec 2008 09:50 AM
acquiring standard out, standard error =?Utf-8?B?UGF1bA==?= Microsoft Dot NET Framework 3 19th Oct 2006 08:23 AM
How do I merge Standard Output and Standard Error using System.Process? Bennett Smith Microsoft Dot NET Framework 0 26th Aug 2004 12:52 AM
Read Standard Output of a Child Process by CreateProcessAsUser Bo Microsoft C# .NET 3 5th Jan 2004 05:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:57 AM.