LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I force the close of a third party ActiveX server.

We have a third party ActiveX executable that refuses to shut itself down once in a while. And when I say once in a while, I mean one out of every 20-30 times it's attempted. All termination commands are being sent and recieved properly, and all refnums are being closed. No errors are ever generated, all operations report successful, but the thing just won't die. Problem is of course, that if we attempt to restart our software after the ActiveX app fails to terminate, it generates server execution errors when trying to open a new instance. We are not expecting a speedy resolution from the third party, but it is becoming a great inconvenience for our customers. I would like to be able to kill the process thro
ugh the OS as a last resort. Problem is, to do that I need a ProcID. Is there any way to retrieve a ProcID for the ActiveX server through LabVIEW? Alternatives and suggestions are welcome.
0 Kudos
Message 1 of 4
(3,033 Views)
If you have labview windows utility toolkit, then it has a vi than lists all the running processes. And, it has another vi that quits running applications. Follow this link if you don't have one.

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EF4556A4E034080020E74861&p_node=ZONE&p_source=external

Joe Guo
0 Kudos
Message 2 of 4
(3,033 Views)
Yes, I thought of this. However the task list from the API library only returns tasks with open windows. The ActiveX server I am using runs windowless. I actually went ahead and built myself a CIN from code I found on msdn (KILL.C) which kills a process by name. It seems to be doing the job. The only complication is that there can be multiple instances of the server at any given time. Just because one instance doesn't shut down properly does not mean that the others will not. Obviously its preferable to shut them down the proper way, so I have to wait for all instances to attempt shutdown and then kill any which remain. Its no big deal, but I was hoping there was some way to identify the specific instance from the refnum in LV.
0 Kudos
Message 3 of 4
(3,033 Views)
Hello codeman,
Thank you for your inquiry regarding closing a third party ActiveX server. It sounds like the third party application is having trouble closing. There are several Windows Utility VIs available that could help in this case. One of the Utility VIs is called Get Window Refnum and should return an instance of a Windows window. The following links are great resources when dealing with this issue.

http://digital.ni.com/public.nsf/websearch/136F6B1F34CBB76E852563FC007AEFC7?OpenDocument

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EF4556A4E034080020E74861&p_node=DZ53008&p_submitted=&p_rank=&p_answer=&p_source=External

Other responses similar to these can be found on the ni.com website by clicking the support tab at the top
of the home page. Then search for �refnum instances� from Technical Resources at the top of the page or topics similar to this. I hope these resources help. Let me know if I can further assist you.

Shea C.
Applications Engineering
0 Kudos
Message 4 of 4
(3,033 Views)