VB 2005 Serial Port Close() Method

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hey all,

I am having problems with the close method of the serial port class in
vb 2005. I have a button on a form that calls the Close() method, but
every now and then the program freezes. I have go into task manager to
end the process to get it to stop.

Just before I call the close() method, I discard the TX/RX buffers and
RemoveHandler my handles to DataReceived and ErrorReceived.

Any insight? Thanks,

Steve P
 
I ended up writing in a timer to expire in 100ms after destroying the
handle and THEN close the port. It seems to work every time.

I think it is probably due to the handle to the DataReceived event.

Steve
 
Back
Top