Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top