D
Denis R Charron
When the serial port is frozen the "Try... Catch" doesn't get the error
because the serial port is using a separate thread.
Is there a way to have the serial thread to communicate with my application
thread?
This is my code:
Try
SerialPort1.Close()
SerialPort1.Dispose()
SerialPort1 = Nothing
System.GC.Collect()
SerialPort1 = New System.IO.Ports.SerialPort
Catch ex As Exception
MessageBox.Show("Error trying to reset the port", "Freelink",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1)
End Try
because the serial port is using a separate thread.
Is there a way to have the serial thread to communicate with my application
thread?
This is my code:
Try
SerialPort1.Close()
SerialPort1.Dispose()
SerialPort1 = Nothing
System.GC.Collect()
SerialPort1 = New System.IO.Ports.SerialPort
Catch ex As Exception
MessageBox.Show("Error trying to reset the port", "Freelink",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1)
End Try