How to detect an active x component that does not respond any more?
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
- has crashed or
- 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.
精彩评论