NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessHandle in 64-Bit TestStand

Solved!
Go to solution

Hi,

 

in sequences from 32-Bit-TestStand (4.1) I get in 64-Bit-TestStand (2014) on "Call Executable" steps the error

 

"-17308: The Process Handle Location step property must be an expression that evaluates to an object reference.  Invalid expression: Step.ProcessHandle".

Now, Step.ProcessHandle does exist as step property. The documentation says that a bitness-independent call should use the expression

 

RunState.Engine.Is64Bit? Step.ProcessHandle64 : Step.ProcessHandle

 

However, Step.ProcessHandle64 does not exist as a property. Is it correct to use Step.ProcessHandlePtr? Would that work in sequences used in 32-bit and 64-bit or is the above conditional expression necessary (with ProcessHandlePtr instead of the not-existing ProcessHandle64)?

 

Regards

 

Peter

0 Kudos
Message 1 of 6
(4,029 Views)
Solution
Accepted by topic author pwaszkewitz

Hello Peter,

 

thank you for your Post.

 

Yes, your guess is right:

Step.ProcessHandle is only supported on 32-Bit Teststand. To use your secuences from a 32-Bit Teststand for a 64-Teststand, you have to  use Step.ProcessHandlePtr. 

 

I hope i could help you.

 

Christian

 

 

0 Kudos
Message 2 of 6
(3,962 Views)

Can somebody pls. give an example on using  ProcessHandleptr ?

regards, Herman
0 Kudos
Message 3 of 6
(2,184 Views)

It really depends on what you are trying to do with it? Are you trying to pass it to a C API, or C#, or LabVIEW? Or what do you want to do with it.

0 Kudos
Message 4 of 6
(2,160 Views)

I have an application with a C-api, so lets first focus on that ...

regards, Herman
0 Kudos
Message 5 of 6
(2,157 Views)

You can pass it as an argument to a function that takes a HANDLE by using the "Pointer/Handle" Category for the argument in the C/C++ adapter or the CVI adapter. Then you can call Win32 APIs that take a process handle, for example, WaitForSingleObject(), TerminateProcess(), and CloseHandle(). Don't forget to call CloseHandle() on it when you are done with it or you will be leaking the process handle.

 

Hope this helps,

-Doug

Message 6 of 6
(2,138 Views)