views:

212

answers:

1

I am working on upgrades to a screen scraping application. We are using an ActiveX control to scrape screens out of an IBM mainframe. The mainframe program often hangs and crashes the ActiveX control causing our application to crash. We don't have access to the mainframe or the ActiveX source code. We are not going to write our own active x control.

What is the bast way to encapsulate an ActiveX control to detect application hangs with the control so we can kill the process and restart with code?

Should I create 2 separate applications? One as a controller that checks on the other and kills/restarts the process when it hangs?

Would they have to be on separate app domains? Is it possible have two programs communicate with each other even if they are on separate app domains?

+1  A: 

You can start an executable with System.Diagnostics.Process.Start(). This returns a Process object with a Responding property that you can use to check periodically if the process is still active.

You'll need two separate applications to do this though. And the application you're monitoring needs to have a main window because the monitoring works by checking if the application still processes messages from the main-window messagequeue. This is the same way windows knows to add "Not responding" to a window-title

Mendelt
Any suggestions on getting the two apps to talk to each other? I'll probably just use a database. Is there a easier way?
ctrlShiftBryan
You can have the applications post stuff in each other's message loops. There are probably better ways for inter process communication though. Try searching SO for IPC..
Mendelt