Using VB6 Winsock in VB.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hamil

    Using VB6 Winsock in VB.net

    Since there is no Winsock for VB.net, I am trying to use the Winsock control
    from VB 6 in my VB.net program. I have "imported" the control to the VB.net
    toolbox and am able to connect to a remote server and send data. My problem
    is in receiving the return message.

    In my VB6 program I have the following and it works....

    Private Sub tcpData_DataArr ival(ByVal bytesTotal As Long)
    Dim strData As String
    tcpData.GetData strData
    tbRecData.Text = strData
    End Sub

    When data arrives, the event fires and tcp.GetData puts the data into the
    string strData..

    My VB.net code is.....

    Private Sub AntData_DataArr ival(ByVal bytesTotal As Long)
    Dim strData As String
    AntData.GetData (strData)
    TextBox1.text = strData
    End Sub

    This doesn't fire for some reason, any help here????? also.....

    There is another code snippit....

    If AntData.BytesRe ceived <> 0 Then
    AntData.GetData (b) 'b is a string

    I have this in a loop, and AntData.BytesRe ceived does count the bytes but
    when I try to get them into a string b, the AntData.GetData (b) fails with an
    errror that I cannot put a string where a byte variable is expected.

    Any help here??????

    Any other suggestions would be appreciated.

    Thanks
    Hamil.



Working...