Windows CE + C# : How to redirect stdout/stderr of child process?

C#

    Next

  • 1. Extracting value from combobox
    I have a combobox I want to extract the "selected value" BUT When I ask in the Immidiate window I get this - an object-valuie I think : ? comboBox_Country.SelectedItem {EstiMate.Components.Exchange.DataLayer.DVExchangeGroup} Href: "https://193.169.16.6/Public/PSA%20KUNDER/(21)%20England/" href: "https://193.169.16.6/Public/PSA%20KUNDER/(21)%20England/" Name: "(21) England" name: "(21) England" And what I want to extract is the "(21) England" in the Name/name of the object - but how ? Best regards KSor, Denmark
  • 2. VS install on vista
    I've picked up another laptop, I'm trying to get VS 08 pro on it, but it won't let me install the framework, every time it says (this OS doesn't support this version of the framework.) It's running Vista home premium at the moment, I can rip that off and put XP on if necessary, but surely that's not necessary? When it tries to install 3.5 it claims it can't find 2.0 sp1, So I downloaded that and it refused to install as per the above, then tried 3 sp1, same issue. It's starting to become tiresome. Thanks DevX
  • 3. ComboBox.PreferredSize
    Hi, In a C#.Net2.0 Winforms application I have some combo boxes. I ind these boxes to enum values and then call ComboBox.Size = ComboBox.PreferredSize: But, the combo box is never wide enough to display long items! Isn't that what PreferredSize is uspposed to give? Am I missing something or is there another way to make sure that my comboboxes are wide enough to display all the text in them? Thanks! Ethan
  • 4. C# Windows Form DataGrid's TextBox KeyPress Event
    Hi, In my C# 1.1 Windows Form Form1, the DataGrid's TextBox KeyPress event, when I hit the "Enter" Key, it does not have any reponse. For other Keys, works fine. How do I fix the problem? Thanks for help. Jason
  • 5. data binding expression for List<int>
    Hi, I am using a method created by other, the function returns List<int>. If I bind this to a Repeater, what should the data binding expresssion looks like? <%# Eval("I don't know what to put in here") %> TIA

Windows CE + C# : How to redirect stdout/stderr of child process?

Postby danebarney » Thu, 31 Aug 2006 11:58:13 GMT

I'm developing a Windows CE 5.0 app using C# and I need to call a child
process and then capture its stdout into a window. The solutions I've
read online for doing this involve either using the CreateProcess(), a
Win32 API function which isn't easily accessible in a C# app, or using
the System.Diagnostics.Process class which seems to only have stdout
redirection capabilities in Win32, but not CE. So what are my best
options?


Similar Threads:

1.Windows CE + C# : How to redirect stdout/stderr of child process?

I'm developing a Windows CE 5.0 app using C# and I need to call a child
process and then capture its stdout into a window. The solutions I've
read online for doing this involve either using the CreateProcess(), a
Win32 API function which isn't easily accessible in a C# app, or using
the System.Diagnostics.Process class which seems to only have stdout
redirection capabilities in Win32, but not CE. So what are my best
options?

2.child process with redirected stdout and stderr

I need to create a child process and read the child's stdout and stderr in
the parent process. This seems to be surprisingly difficult to do in .NET.

The documentation for the System.Diagnostics.Process class talks about
creating separate threads for reading each stream.

Is there an easier way? Has anyone already written a wrapper?

Thanks.


3.Redirecting stdout/stderr on child process to a window

I'm developing a Windows CE 5.0 app using C# and I need to call a child
process and then capture its stdout/stderr into the textbox of a
window. So I'm P/Invoking the CreateProcess() function and the
SetStdioPathW() function. However, it seems that SetStdioPathW() is
intended for redirecting output to a file, not a window. What should I
be using instead?

4.Redirect stdout/stderr on spawned process (was TerminateProcess does not immediatly exit the process)

"OT" < XXXX@XXXXX.COM > wrote in message news:f1q0cq$ak0$ XXXX@XXXXX.COM ...

> the problem is:
>  - the external exe file can take a very long time to do its work, so
>    i want to give the user the possibility to say "ok, i'm boring. I
>    want to quit and i want to quit now".
>    The only way to quit now is to kill the process ng_dist.exe, since
>    it only quit when it finishes to write its output.
>  - the same external exe file uses stdout and stderr to give back data,
>    so if I run
>    CreateProcess( ..., "cmd /d ng_dist.exe 1>output.txt 2>err.log", ...)
>    it works but if I run
>    CreateProcess( ..., "ng_dist.exe 1>output.txt 2>err.log", ...)
>    it seems to work (CreateProcess returns nonzero) and i can see
>    ng_dist.exe running in the task manager, but it dosn't write
>    anything on any file!
>
> the solution (?)
>  - i'm afraid the only solution is to have a new release of the external
>    exe file to avoid the use o stdin / stdout. Is it correct?
>

So the question has become, how to use CreateProcess() and specify 
redirection of stdout and stderr to files.  I'm afraid I don't know, but I 
renamed the Subject to hopefully attract more appropriate attention.

Thanks,
David 


5.Capturing spawned child process's STDOUT & STDERR

Hello,
   I'm using _execvpe (Win32 console project in VS.NET) 
to spawn a child process. I would like to know if you 
have any pointers on how to capture the child's STDOUT 
and STDERR? Any help is greatly appreciated.

Thanks,
Sri



Return to C#

 

Who is online

Users browsing this forum: No registered users and 3 guest