05-06-2010 10:27 AM
How do I close the process handle as recommended under "Wait Options" tab? This under the properties of a Call Executable step in TestStand. The process handle stored in a TS variable but there is no example of how to close it.
05-11-2010 11:00 AM
Hi Brian the TE,
In order to close the process handle that you create in the "Wait Options" tab you must use the Windows CloseHandle function. In order to do this you need to use a C/C++ action step. You can then browse to the kernel32.dll module in the C:\WINDOWS\system32\kernel32.dll directory. You should then be able to select the CloseHandle function from the populated drop-down menu. It will give you a message saying that TestStand does not recognize this function, but that is OK. You can then add a parameter that will input the process handle that you created in the Call Executable step.
05-31-2017 06:44 AM
Yes, this thread is "a bit" aged...
In TestStand anything worked as explained. I opened an EXE, had my way with it, called "TerminateProcess" and even "CloseHandle" afterwards.
Then, I tried to pack both into one VI but had no luck with the Call Library function.
Function prototypes were:
void TerminateProcess(uint32_t hProcess, uint32_t uExitCode);
and
void CloseHandle(uint32_t hProcess);
but I also tried with different representations and with pointers. No success. I don't see any reaction but also get no error message. According to the forum the "void" return code is not the issue.
Any ideas what I could try?
05-31-2017 06:50 AM
Posting this question to the LabVIEW or TestStand board will help in getting the better response!
05-31-2017 07:00 AM
Uuups, thought it was in the TS board... Sorry.
04-29-2022 02:15 AM
@Ryan_T wrote:
Hi Brian the TE,
In order to close the process handle that you create in the "Wait Options" tab you must use the Windows CloseHandle function. In order to do this you need to use a C/C++ action step. You can then browse to the kernel32.dll module in the C:\WINDOWS\system32\kernel32.dll directory. You should then be able to select the CloseHandle function from the populated drop-down menu. It will give you a message saying that TestStand does not recognize this function, but that is OK. You can then add a parameter that will input the process handle that you created in the Call Executable step.
Like this?