Hi:
We seem to have found a strange combination of conditions which causes a file to be locked (unable to be deleted/renamed).
Here is the scenario:
* modified full featured teststand 4.0.1 CVI user interface with a timer callback called every second (using CVI 8.0.1)
--> callback calls LaunchExecutable with command.com (just running 'dir' in the example, but normally I'm piping output from another exe to a file)
--> callback creates and writes to a file using fopen/fputs/fclose
* run a sequence (WriteAFile.seq) which calls a DLL which continuously writes to a different file (c:\temp\writeafile.txt) using the CVI WriteFile function
* if the DLL is called several times (1000+), after completion writeafile.txt appears locked - it can not be deleted until the user interface is shutdown
All relevant files are attached. Unzip to c:\temp\ and try running the sequence. Choosing 1000 loops almost always causes the file to be locked. Less loops and the problem appears more intermittant.
If you do any one of these three things, the problem appears to go away
* remove command.com from the LaunchExecutable call in the user interface callback
* remove fputs call from the user interface callback
* change the write functions in writeafile.dll to use fopen/fputs/fclose
Any ideas on what is going on here? Our workaround for now is to change the write functions to fopen/fputs/fclose, but I'm concerned there could be problems in other places that I'm not aware of. We are investigating user interface crashes and I want to make sure this callback is not a factor.
Thanks,
Dave