AusTEX Posted May 13, 2011 Report Share Posted May 13, 2011 I have an application where I have to call a third party dll to do some calculations. Sometimes these calculation can take a long time and I would like to be able to provide the user with a stop button so they can abort the calculation. So far I haven't been able to figure out how I can abort the dll before it is finished. I thought I might be able to use the taskkill command (this is on a windows XP machine). I can use the taskkill command to shut down any exe that is running but either it doesn't work for stopping a dll or maybe I don't have the syntax right. I also tried using the VI server to abort the vi that calls the dll but that didn't work either. Any ideas on how I can abort the dll? Quote Link to comment
jdunham Posted May 13, 2011 Report Share Posted May 13, 2011 I have an application where I have to call a third party dll to do some calculations. Sometimes these calculation can take a long time and I would like to be able to provide the user with a stop button so they can abort the calculation. So far I haven't been able to figure out how I can abort the dll before it is finished. I thought I might be able to use the taskkill command (this is on a windows XP machine). I can use the taskkill command to shut down any exe that is running but either it doesn't work for stopping a dll or maybe I don't have the syntax right. I also tried using the VI server to abort the vi that calls the dll but that didn't work either. Any ideas on how I can abort the dll? I don't think you can abort the DLL easily, since it's running inside your own app. Killing it would be literally suicidal. You could try to break up the calculations, so that you call the DLL more often (this is easier if you could modify the DLL code). You could write another LabVIEW app to run the DLL, and use TCP or network queues to communicate between the apps. That would make the DLL app killable, but it's a lot of work considering that your stated purpose is a slight improvement of the user experience. Quote Link to comment
Tim_S Posted May 26, 2011 Report Share Posted May 26, 2011 I have an application where I have to call a third party dll to do some calculations. Sometimes these calculation can take a long time and I would like to be able to provide the user with a stop button so they can abort the calculation. The options I can think of require you to be able to modify the DLL. 1. The DLL could pop-up a progress window with a cancel button. 2. The data is sent to the DLL to calculate and the function call returns immediately. The DLL processes the data in the background and performs a callback when the calculation is finished. Another function call could be used to abort the calculation. Tim Quote Link to comment
Jordan Kuehn Posted May 26, 2011 Report Share Posted May 26, 2011 Couldn't you kill the process via the command line? This VI from the dark side shows some of the commands. https://decibel.ni.com/content/docs/DOC-9277 Quote Link to comment
jdunham Posted May 26, 2011 Report Share Posted May 26, 2011 Couldn't you kill the process via the command line? This VI from the dark side shows some of the commands. https://decibel.ni.c...t/docs/DOC-9277 A executing functions within a DLL are done within your process. You can't kill a DLL separately from the app. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.