Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: show tooltip even if treeview doesn't have focus? Pin
FocusedWolf13-Jun-09 22:01
FocusedWolf13-Jun-09 22:01 
QuestionRead from process Pin
thomaxz.tc13-Jun-09 9:37
thomaxz.tc13-Jun-09 9:37 
AnswerRe: Read from process Pin
Luc Pattyn13-Jun-09 10:12
sitebuilderLuc Pattyn13-Jun-09 10:12 
GeneralRe: Read from process Pin
thomaxz.tc13-Jun-09 12:29
thomaxz.tc13-Jun-09 12:29 
GeneralRe: Read from process Pin
Luc Pattyn13-Jun-09 12:37
sitebuilderLuc Pattyn13-Jun-09 12:37 
GeneralRe: Read from process Pin
thomaxz.tc13-Jun-09 12:47
thomaxz.tc13-Jun-09 12:47 
GeneralRe: Read from process Pin
Luc Pattyn13-Jun-09 13:37
sitebuilderLuc Pattyn13-Jun-09 13:37 
GeneralRe: Read from process Pin
thomaxz.tc13-Jun-09 23:32
thomaxz.tc13-Jun-09 23:32 
>1.
>Why do you ignore the documentation, it says:
>The event is enabled during asynchronous read operations on StandardOutput.

>To start asynchronous read operations, you must redirect the StandardOutput stream of a Process,

As in my lower code

proc.StartInfo.RedirectStandardOutput=true;


Ise'nt that an redirect?

>add your event handler to the OutputDataReceived event

proc.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(SortOutputHandler);


Ise'nt that an event handler for the OuptuDataRecevide?

>And call BeginOutputReadLine.

proc.Start();
proc.BeginOutputReadLine();


Ise'nt that a Call to BeginOutputReadLine?

>Thereafter, the OutputDataReceived event signals each time the process writes a line to the >redirected StandardOutput stream, until the process exits or calls CancelOutputRead.

I still get no data.

2.
>The DataReceived event executes on a ThreadPool thread, not on the main thread; so you are not >allowed to touch any Control, however you could use Console.WriteLine() for debugging purposes. To >touch Controls, you need the Control.InvokeRequired/Control.Invoke pattern.
>BTW: Setting Control.CheckForIllegalCrossThreadCalls false is NOT the solution.

OK? all the other time i have code treate and i wasen allowed i was getting a cross thread error, with i don't do here.

futher more have i change my code af bit, do reflect invoek
private delegate void TextAdderDelegate(string str);
		
void TextAdder(string str)
{
   if(this.lsw1.InvokeRequired==true)
   {
      Invoke(new TextAdderDelegate(TextAdder),new object[] {str});
   }
   else
   {
      this.lsw1.Items.Add(str);
   }
}
		
void SortOutputHandler(object o,System.Diagnostics.DataReceivedEventArgs e)
{
   string str="";
	
   if(e!=null)
   {
      if(e.Data!=null)
      {
         str=e.Data.ToString();
      }
   }
   TextAdder(str);
}


But I still not get any data.
And when i make a breakpoint, it only runs when the process finished.
Questionload a lot of Images to memory Pin
nryk13-Jun-09 8:57
nryk13-Jun-09 8:57 
AnswerRe: load a lot of Images to memory Pin
Luc Pattyn13-Jun-09 9:37
sitebuilderLuc Pattyn13-Jun-09 9:37 
GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 11:55
harold aptroot13-Jun-09 11:55 
GeneralRe: load a lot of Images to memory Pin
Luc Pattyn13-Jun-09 14:29
sitebuilderLuc Pattyn13-Jun-09 14:29 
GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 14:36
harold aptroot13-Jun-09 14:36 
GeneralRe: load a lot of Images to memory Pin
Luc Pattyn13-Jun-09 15:17
sitebuilderLuc Pattyn13-Jun-09 15:17 
AnswerRe: load a lot of Images to memory Pin
nryk13-Jun-09 18:05
nryk13-Jun-09 18:05 
GeneralRe: load a lot of Images to memory Pin
Dave Kreskowiak13-Jun-09 21:46
mveDave Kreskowiak13-Jun-09 21:46 
AnswerRe: load a lot of Images to memory Pin
Guffa13-Jun-09 21:26
Guffa13-Jun-09 21:26 
GeneralRe: load a lot of Images to memory Pin
nryk13-Jun-09 21:40
nryk13-Jun-09 21:40 
GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 22:38
harold aptroot13-Jun-09 22:38 
GeneralRe: load a lot of Images to memory Pin
Guffa13-Jun-09 23:30
Guffa13-Jun-09 23:30 
GeneralRe: load a lot of Images to memory Pin
nryk14-Jun-09 0:16
nryk14-Jun-09 0:16 
GeneralRe: load a lot of Images to memory Pin
Guffa14-Jun-09 21:18
Guffa14-Jun-09 21:18 
QuestionDockPanel Suite Pin
Rafone13-Jun-09 6:24
Rafone13-Jun-09 6:24 
AnswerRe: DockPanel Suite Pin
Henry Minute13-Jun-09 6:34
Henry Minute13-Jun-09 6:34 
GeneralRe: DockPanel Suite Pin
Rafone13-Jun-09 7:18
Rafone13-Jun-09 7:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.