G
Guest
Hi everyone,
I would appreciate any help concerning this threading issue.
I am using the comm port, and receiving data from the comm port fine.
I am updating the system.form controls, text boxes, using "begininvoke" and
the updates occur, no problem.
However after the update,, the form is about as responsive as a herd of
turtles running through peanut butter. What am I missing?
Here is the code:
GENERAL:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Shared m_FormDefInstance As Form1
....
etc.
-------------------------------------------
Form1 Load event:
m_FormDefInstance = Me
etc.
------------------------------------------
Comm port:----------------------------
Private Sub m_CommPort_DataReceived(ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles
m_CommPort.DataReceived
Dim strModemRecBuffer As String = ""
strModemRecBuffer = m_CommPort.ReadExisting
'Update MAINFORM Controls
m_FormDefInstance.BeginInvoke(New _
DisplayData(AddressOf ProcessCallerData), _
New Object() {strModemRecBuffer})
End Sub
------------------------------------------------------------
Public Delegate Sub DisplayData(ByVal strCallerIdDataBuffer As String)
Private Sub ProcessCallerData(ByVal strCallerIdDataBuffer As String)
'Update the text box with caller-id (Works fine)
' I do some formatting for the <Cr> in the caller-id fields, but
'that is all working fine
text1.text = strCallerIdDataBuffer
text1.refresh
end sub
The caller-id data comes out fine, and then the form goes to slug mode.
Any help would be appreciated, thank-you in advance
Am I missing something with the thread?
I would appreciate any help concerning this threading issue.
I am using the comm port, and receiving data from the comm port fine.
I am updating the system.form controls, text boxes, using "begininvoke" and
the updates occur, no problem.
However after the update,, the form is about as responsive as a herd of
turtles running through peanut butter. What am I missing?
Here is the code:
GENERAL:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Shared m_FormDefInstance As Form1
....
etc.
-------------------------------------------
Form1 Load event:
m_FormDefInstance = Me
etc.
------------------------------------------
Comm port:----------------------------
Private Sub m_CommPort_DataReceived(ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles
m_CommPort.DataReceived
Dim strModemRecBuffer As String = ""
strModemRecBuffer = m_CommPort.ReadExisting
'Update MAINFORM Controls
m_FormDefInstance.BeginInvoke(New _
DisplayData(AddressOf ProcessCallerData), _
New Object() {strModemRecBuffer})
End Sub
------------------------------------------------------------
Public Delegate Sub DisplayData(ByVal strCallerIdDataBuffer As String)
Private Sub ProcessCallerData(ByVal strCallerIdDataBuffer As String)
'Update the text box with caller-id (Works fine)
' I do some formatting for the <Cr> in the caller-id fields, but
'that is all working fine
text1.text = strCallerIdDataBuffer
text1.refresh
end sub
The caller-id data comes out fine, and then the form goes to slug mode.
Any help would be appreciated, thank-you in advance
Am I missing something with the thread?