开发者

How to detect an active x component that does not respond any more?

开发者 https://www.devze.com 2022-12-23 12:39 出处:网络
My application is written in C++ and uses the Qt framework. I use the QAxWidget class to access an active x component. Now I need some kind of mechanism that notifies my application each time the acti

My application is written in C++ and uses the Qt framework. I use the QAxWidget class to access an active x component. Now I need some kind of mechanism that notifies my application each time the active x component

  1. has crashed or
  2. does not respond any more (due to dead lock or infinit开发者_运维知识库e loop).

(1) can easily been done by watching the external process of the active x component. But maybe there is a more elegant approach?

But how can (2) be implemented?


One simple solution would be to have the ActiveX widget listen to a UDP port and basically implement some kind of ping mechanism. Then you ping the port and if you get nothing back you can assume there is trouble.

Or you could use QLocalServer.

0

精彩评论

暂无评论...
验证码 换一张
取 消