Jump to content
Tuts 4 You

Problem with winsock.sendData on chinese operative systems VB6


Recommended Posts

Hello, I have coded a software, and its working fine on latin and english operative systems, but it does not work godd on Chinese Windoxs XPI have a module, for strings, conversion etc etc....Code is:

st1 = HexToAsc("100404084A011004C8DC")Winsock2.SendData st1

in latin server / client app, I receive very same string I sent....


I use winsock.GetData but on chinese windows xp it does not

I receive this:

100404084A0110040000 (C8DC is now 0000)what could the problem be??


unicode related??





Link to comment

yeh i'd point the finger at unicode or right to left stuff...

without seeing the actual code, its hard to say, but its a good place to start

Edited by evlncrn8
Link to comment

Thanks, there is not much to see in the code...


here it is....

Private Sub Command7_Click()
Winsock2.Connect End Sub
Private Sub XT_Click()
st1 = HexToAsc("100404084A011004C8DC")
Winsock2.SendData st1 Timer1.Enabled = True End Sub
Private Sub Timer1_Timer()
Dim daAr() As Byte
Dim daStrg As String Text3 = T1
If T1 >= 5 Then
MsgBox "Timeout", vbCritical, "Timeout"
Timer1.Enabled = False
T1 = 0 Exit Sub
End If If Winsock2.State = 7 And T1 >= 2 Then Winsock2.GetData daAr
daStrg = StrConv(daAr, vbUnicode)
Text1 = daStrg
Text2 = StringToHex(daStrg)
Text2 = Replace(Text2, " ", "")
Timer1.Enabled = False T1 = 0
End If
T1 = T1 + 1
End Sub

I connect, then send the data (data is converted to from hex to ascii by a function in module)


then I call to timer, it waits for 2 seconds, and then reads reply...


problem is sending data....


no matter about right to left, because if I invert string like this: st1 = HexToAsc("C8DC100404084A011004")


0000100404084A011004 is sent....




Link to comment

problem solved...


I found how to enable compatibility under chinese windows, and now, it works perfect






Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...