I have writen a program to talk over the serial COMS using 'Mscomm' the program works fine.
The problem I have with it is I need to detect whether the coms lead has been disconnected or connected, even if the program is not talking. At the moment if I disconnect the serial lead when the program is not talking it crashes, and then if I run it again (program still not talking or trying to talk) and connect the lead it crashes again.

Can anybody Help
Cheers
JC