The code is after an infinite "while" loop. The thread is terminated by the typical "WaitonMultipleObjects()" function and the code I display is how I restore the comm port to its original settings, purge it, and close the handle.

Yet when I try to reopen the port with "CreateFile()", I get an access denied. Thhe only thing I can think of which would cuse that is that the system still believes I am using it.

By the way, what's the difference between

"SetCommState()" and
"SetCommConfig()". The structure passed to the former is contained in the structure passed to the latter. Then there always is the
"SetDefaultCommConfig()"

I should try the last for laughs.

Brian