Sign in to follow this  
Leafteaner

System.Diagnostics.Process, how to handle a process crash?

Recommended Posts

Leafteaner    860
I wrote a batch converter that searches all given directories and converts all 3DS models to directx .x meshes by calling Conv3DS.exe using System.Diagnostics.Process in C# using VS2005 Pro. Conv3DS.exe is a command line tool, and the vast majority of the time works fine, but when converting certain 3ds files it crashes. when the process crashes it alerts the user, and after clicking cancel in the msg box that comes up, the main program continues on normally and converts the rest of the files until it either finishes or crashes again. Is there a way for the Process object to manage the program crash without the user having to deal with it? i am having trouble because the crash occurs after the Start() and WaitForExit() methods have been called and the main program is just waiting for the process to end. Any help would be amazing

Share this post


Link to post
Share on other sites
benryves    1999
I'm not really sure what you're asking for. You can check if an application is still responding by polling Process.Responding. It might be a better idea to catch the Process.Exited event from the process to detect when it has finished rather than WaitForExit(). I'd have thought that the process was seen as responding and not exited during the time the error dialog is up, though.

As far as automatically clicking on a dialog thrown up by the OS, I really have no idea how to solve that. I think the problem is not so much at your end and more at the end of the broken Conv3DS.exe utility.

Share this post


Link to post
Share on other sites
Leafteaner    860
Thanks for the reply.

Yeah... I know that the Conv3DS.exe crashing is outside my control, I was just hoping that there is a way to for my program to realize that it crashed since it invoked it to begin with. But it looks like Process.Start() just has the OS run the process and deal with it. Time to find a better 3ds to .x converter...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this