Re: Exception launcing processes



OK, sorry. The text of the exception?

Paul T.

<andrerus@xxxxxxxxx> wrote in message
news:1161332625.534426.64880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Probabibly I should be explicit, however I'm developing for Mobile,
this code is fulli supported by WinCE.

Andrea

Paul G. Tobey [eMVP] ha scritto:

You realize that you posted this to a Windows CE, not a Windows desktop,
group? I think you'll have a better chance of getting good help in a
more-appropriate group.

Paul T.

<andrerus@xxxxxxxxx> wrote in message
news:1161297371.890676.30520@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, I'd like understanding why, when I launch a process from inside my
application I receive or no an exception, depending on the program I
try to launch. This is the code I execute:

externApp = System.Diagnostics.Process.Start(fullnameApp, "");

IntPtr hwndExt = IntPtr.Zero;
do
{
System.Threading.Thread.Sleep(500);
externApp.Refresh();
hwndExt = externApp.MainWindowHandle; //this line throws
InvalidOperationException
}
while (hwndExt.Equals(IntPtr.Zero));

If fullnameApp = "/Windows/calc.exe", no exception occurr,
if instead fullnameApp = "/Windows/iexplore.exe" exception is thrown.

Analising both cases with debugging before executing the impeached line
I saw that in first case it has exited field and HasExited property =
false, instead in the latter, in a first moment exited field is false
and HasExited true, but then both became true, even if the process is
still alive.

Which is the reason of it?

Thanks,
Andrea




.



Relevant Pages

  • Re: Exception launcing processes
    ... Paul G. Tobey ha scritto: ... I saw that in first case it has exited field and HasExited property = ... and HasExited true, but then both became true, even if the process is ...
    (microsoft.public.windowsce.app.development)
  • Re: evc4 compiler/linker producing corrupt executables
    ... Paul T. ... I have also built an "empty" program ... 0xc00000005 is a data abort exception. ... The corrupt executables are about 28kb, ...
    (microsoft.public.windowsce.embedded)
  • Re: Exception launcing processes
    ... Here are exception details: ... Paul G. Tobey ha scritto: ... I saw that in first case it has exited field and HasExited property = ... and HasExited true, but then both became true, even if the process is ...
    (microsoft.public.windowsce.app.development)
  • Re: Bypassing startup macros
    ... Is there a command line I can use to open it up without using the macros? ... "Paul B" wrote: ... >> Excel is now throwing an illegal exception preventing me from opening the ... >> Sion Smith ...
    (microsoft.public.excel.programming)
  • Re: Shell_NotifyIcon problem
    ... >> Paul T. ... >>> I am creating a system tray icon using the ... But when exception occurs and i try to delete ... > Rajat Lala ...
    (microsoft.public.windowsce.embedded)

Loading