Starting a process with OpenNETCF - odd behaviour

  • Thread starter Thread starter Jon Skeet [C# MVP]
  • Start date Start date
J

Jon Skeet [C# MVP]

I'm using Process.Start within OpenNETCF.Diagnostics. For some reason,
the process only gets run when I pop up a message box - even though I
use WaitForExit!

This is a bit of a pain, for obvious reasons. My "child" process is a
non-graphical application, but I'm not sure why that would be relevant.

How can I tell WinCE to give the other process time? Thread.Sleep
doesn't help either, btw...
 
Jon Skeet said:
I'm using Process.Start within OpenNETCF.Diagnostics. For some reason,
the process only gets run when I pop up a message box - even though I
use WaitForExit!

This is a bit of a pain, for obvious reasons. My "child" process is a
non-graphical application, but I'm not sure why that would be relevant.

How can I tell WinCE to give the other process time? Thread.Sleep
doesn't help either, btw...

I failed to mention that I'm doing this in the UI thread. It looks like
Application.DoEvents does the appropriate stuff. Nasty, but okay in
this instance. Fortunately it's a developer-only tool, so it doesn't
need to be quite as robust as usual... (Usually I'd put things in a
different thread, of course.)
 
Jon Skeet said:
I failed to mention that I'm doing this in the UI thread. It looks like
Application.DoEvents does the appropriate stuff. Nasty, but okay in
this instance. Fortunately it's a developer-only tool, so it doesn't
need to be quite as robust as usual... (Usually I'd put things in a
different thread, of course.)

Aargh - even DoEvents only helps somewhat. I now loop round calling
DoEvents until I've noticed the files I'm waiting for have been
created. Yuk.
 
Back
Top