Utility Library Chapter 8
LabWindows/CVI Standard Libraries 8-48 © National Instruments Corporation
A handle can be passed to ExecutableHasTerminated and TerminateExecutable.
When you no longer need the handle, you should call RetireExecutableHandle. When
you do not want to obtain a handle, you can pass NULL.
When you launch several processes with LaunchExecutableEx but do not call
RetireExecutableHandle on them, you might reach the limit for the maximum number of
processes the system imposes. This happens even when the processes have already terminated;
the program does not recognize that the processes have terminated until you call
RetireExecutableHandle.
Checking Termination of CVI Executables Under Windows 3.1
If you launch another LabWindows/CVI executable under Windows 3.1, the launched executable
process will terminate itself after launching the new copy of the CVI Run-time Engine. If you
use ExecutableHasTerminated, the return value always will be 1 because the process
identification for the second Run-time Engine cannot be tracked. This behavior can also occur
with non-LabWindows/CVI executables.
You can work around this problem when launching LabWindows/CVI runtime executables by
executing the Run-Time Engine directly and passing it the pathname of the executable. For
example:
c:\cvi\cvirt4.exe c:\test\myapp.exe
The pathname of the Run-Time Engine might not be c:\cvi\cvirt4.exe. You can
determine the pathname of the Run-Time Engine by looking at the [cvirt4] section in
win.ini. (If the runtime executable was made with a different version of CVI, look in the
[cvirtnn] section for that version.)
If you need to pass arguments to your application, create a file containing the arguments and pass
the pathname of that file as the second argument to the Run-Time Engine. For example:
c:\cvi\cvirt4.exe c:\test\myapp.exe myargs
The file containing the arguments must be in the same directory as the executable. The first three
characters in the file containing the arguments must be “CVI” in uppercase, as in the following
example:
CVI arg1 arg2 arg3
The Run-Time Engine deletes the file containing the arguments after reading it.