You should not be closing a Labview program while a DLL which it calls is still running. Wait until the DLL is done, then close Labview. Otherwise you will have problems. I am assuming that when LV calls a DLL, it pushes some values onto a stack, and when the DLL is done, the values are popped from the stack so that LV can continue where it was when it called the DLL. When closing LV before the DLL is done, those values on the stack are abandonned, and the next process to pop from the stack will get wrong values. The stack contains such info as where is the address of the next instruction to be run. Things get really screwed up, and could result in an entire system crash. Fortunately in this case the OS is able to recognize the LV error and is able to clean things up, so only LV is shutdown. Consider getting rid of the DLL and doing the functions in Labview. Make a subvi, and you can call it from other LV programs. I stay away from DLLs as much as I can. Of course you have to use them in cases like instrument drivers and such. But if I can write LV code to do the same, I will do so and eliminate the DLL.