vb6 programming,udp network and picaxe help

buntay

Senior Member
Hey all,

I recently purchased a network module and have it working great with the supplied software, now i am writing my own VB6 program but my problems lay with picaxes ,CR,LF.......I cant get my program to recognize this and VbCr in the Richtxtbox1. I would say I am a intermediate VB6 programmer so,

here is the Picaxe code.
Code:
'PICAXE 20X2

setfreq m8
PAUSE 5000



main:

pause 1000
serout B.0,t9600, ("sending data!!",cr,lf)
PAUSE 2000

goto main

and here is the VB6 code I am using......protocol is UDP, I can get the data to show up in the box but there are no carriage returns or line feeds

Code:
Private Sub Form_Load()

     Winsock1.Close

     Winsock1.Protocol = sckUDPProtocol

     Winsock1.Bind 2434

End Sub

 

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

    Dim str As String

    Winsock1.GetData str
Rich1.Text = str
 

End Sub

 

Private Sub Form_Unload(Cancel As Integer)

    Winsock1.Close

End Sub
can any VB6'rs tell me how to make this play nice? And explain why?
Any help, as always, is greatly appreciated

Buntay
 

buntay

Senior Member
Well, Hahahahahaha... figured it out. But for those who may run into the same problem. Here is the VB6 code to make it work.

Code:
Private Sub Form_Load()

     Winsock1.Close

     Winsock1.Protocol = sckUDPProtocol

     Winsock1.Bind 2434

End Sub

 

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

    Dim str As String

    Winsock1.GetData str
Rich1.Text = Rich1.Text + str      'This will put new incomming data on a new line.
 

End Sub

 

Private Sub Form_Unload(Cancel As Integer)

    Winsock1.Close

End Sub
 
Top