LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"Store Process Handle" option under TestStand call executable

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.

0 Kudos
Message 1 of 6
(5,625 Views)

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. 

 

Ryan T
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(5,584 Views)

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?

0 Kudos
Message 3 of 6
(4,185 Views)

Posting this question to the LabVIEW or TestStand board will help in getting the better response!



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(4,181 Views)

Uuups, thought it was in the TS board... Sorry.

0 Kudos
Message 5 of 6
(4,178 Views)

@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?

 

CloseHandle.png

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
Message 6 of 6
(2,062 Views)