12-11-2015 08:46 AM
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
Solved! Go to Solution.
12-17-2015 06:24 AM
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
01-22-2019 02:18 PM
Can somebody pls. give an example on using ProcessHandleptr ?
01-24-2019 08:01 AM
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.
01-24-2019 08:08 AM
I have an application with a C-api, so lets first focus on that ...
01-25-2019 09:11 AM
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