Note that there are some explanatory texts on larger screens.

plurals
  1. POConsole information to window
    primarykey
    data
    text
    <p>I already know how to catch standard output of a console window, BUT my problem is the case when I get the process with GetProcesses/orByName and do not Start() it myself. Here is the code:</p> <pre><code>public ProcessCaller(ISynchronizeInvoke isi, Process MárFutóAlkalmazás) : this(isi) { //alapbeállítások FileName = MárFutóAlkalmazás.StartInfo.FileName; Arguments = MárFutóAlkalmazás.StartInfo.Arguments; WorkingDirectory = MárFutóAlkalmazás.StartInfo.WorkingDirectory; //egyedi beállítások process = MárFutóAlkalmazás; process.EnableRaisingEvents = true; process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; new MethodInvoker(ReadStdOut).BeginInvoke(null, null); new MethodInvoker(ReadStdErr).BeginInvoke(null, null); //események StdErrReceived += new DataReceivedHandler(Loggolás); StdOutReceived += new DataReceivedHandler(Loggolás); //kilépés jelzése process.Exited += new EventHandler(OnKilépés); } </code></pre> <p>So this method gets and already running application as MárFutóAlkalmazás parameter. Sets some internal properties, then hooks to Output. However when it comes to</p> <pre><code>StdOutReceived += new DataReceivedHandler(Loggolás); </code></pre> <p>and the program runs the Loggolás method to take the console data, it says that the StandardOut is not set, or the process is not started.</p> <p>Well:</p> <ul> <li>StandardOut is set</li> <li>Process is running, since I get it by GetProcesses</li> <li>In this routine I do NOT use process.Start() - since it is started already</li> </ul> <p>Looking for help. Thank yas: Péter</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload