Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15933

TCPListener maybe thread issue??

$
0
0
I have a program that has 2 forms. In one form I have a TCPListener running in the thread. This part works fine and receives the data like it should.
When the data is received I am trying to place what is received in a textbox on another form.
On the other form the routine that places the text in the textbox I have tried checking to see if an invoke is needed and it always returns false. So I have a statement like this
Code:

Public Sub ImportExternalADIFStringInvoke(ByVal aStr As String)
        Try
            If InvokeRequired Then
                Dim d As New ImportExternalADIFStringDelegate(AddressOf ImportExternalADIFString)
                BeginInvoke(d, [aStr])
            Else
                ImportExternalADIFString(aStr)
            End If
        Catch e As Exception
            Debug.Print(e.Message)
        End Try
    End Sub

Public Sub ImportExternalADIFString(ByVal aStr As String)
        Try

            Debug.Print(aStr)
            Loggedvia.Text = ""
            Log.Text = ""

            Log.Text = aStr

The debug statement prints out the contents of aStr but the log window does not display any text. If I break the routine after this point and I hold the mouse over Log.text it shows that the contents contain what aStr holds but the text is not visible in the textbox. I have double checked all of the settings for the textbox and if I enter text in the controls setup it shows in the window.

This is driving me nuts as to why the text does not show...
I have also tried saving the tcp output in a global variable and tried reading it in the other form but that gives the same no print text output.

Any ideas as to what I am not seeing??
TIA
Rick

Viewing all articles
Browse latest Browse all 15933

Latest Images

Trending Articles



Latest Images