|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB 2005 Serial Port Close() MethodHey 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 On May 2, 2:54 pm, Steve <smpick***@gmail.com> wrote: Show quote > 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 |
|||||||||||||||||||||||