检测应用在.NET中使用ActiveX控件挂起 [英] Detecting application hangs with ActiveX controls in .Net

查看:101
本文介绍了检测应用在.NET中使用ActiveX控件挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在升级到一个屏幕抓取应用程序。我们使用ActiveX控件刮筛选出一台IBM大型机。大型机程序经常挂起和崩溃的ActiveX控件使我们的应用程序崩溃。我们没有访问主机或源代码的ActiveX code。我们不会写自己的Active X控件。

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.

什么是麻的方式来封装ActiveX控件来检测应用程序挂起的控制,所以我们可以终止该进程,然后重新启动与code?

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?

我应该创建2个独立的应用程序吗?一个作为控制器来检查在另一并杀死/重新启动该过程时,它挂起?

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?

推荐答案

您可以开始与System.Diagnostics.Process.Start一个可执行文件()。这将返回一个Process对象与响应特性,你可以用定期检查过程中仍处于活动状态。

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.

您需要两个单独的应用程序要做到这一点,虽然。而你监视应用程序都需要有一个主窗口,因为监控工程通过检查应用程序仍处理从主窗口messagequeue消息。这是相同的方式窗户知道要加上没有响应的一个窗口标题

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

这篇关于检测应用在.NET中使用ActiveX控件挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆