Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

process.WaitForExit() problem on framework 2.0 beta

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Berni - 11 Aug 2005 18:42 GMT
Hello

I have a programm that executes other processes. Everything was fine with
framework 1.1.

Now i have tested the assembly (still build with VS2003, framework 1.1) on
the framework 2.0 beta.

Unfortunatly in some cases, the method "process.WaitForExit()" waits
infinite. When the process exits, it does not affect the WaitForExit method.
If i replace the WaitForExit method with an interop call to kernel32.dll ->
WaitForSingleObject it works perfectly again.

Berni

[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern int WaitForSingleObject(IntPtr hHandle, uint
dwMilliseconds);
...

//this.process.WaitForExit();
WaitForSingleObject(this.process.Handle, 0xFFFFFFFF);
Berni - 11 Aug 2005 20:37 GMT
okay .. it was a little bit to eary for my post.
unfortunatly the "WaitForSingleObject" solution does not solve the problem.
The problem starts already when the process starts.

my code looks like this:
ProcessStartInfo processStartInfo=new ProcessStartInfo();
processStartInfo.FileName=executable;
processStartInfo.WorkingDirectory=workingDirectory;
this.process=Process.Start(processStartInfo);

The code hangs at the forth line (Process.Start). I see that the process is
started, but my programm does not continue to work at this point !

Please help,

Benri

> Hello
>
[quoted text clipped - 18 lines]
> //this.process.WaitForExit();
> WaitForSingleObject(this.process.Handle, 0xFFFFFFFF);

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.