I found an obscure piece of documentation on the MSDN which says that after one calls 'CloseHandle(commhandle)' that there is a two second delay for the system to close resources. Unfortunately it's not in the documentation that comes with VC++ in the description of the serial port functions.

In any case, with a Sleep(2000) function placed after the CloseHandle() function, the problem is solved. Who would have guessed it was 2 seconds!

Brian