Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   winsock's SendData and GetData problem (http://www.go4expert.com/forums/winsocks-senddata-getdata-t15961/)

yoz1ris 27Jan2009 17:32

winsock's SendData and GetData problem
 
Dear friends,

I have tried to make a simple program that enumerates Windows caption/process on a Server.
Then, the server sends the enumerations to a Client comp through net via winsock.
I expect the program in client comp. to list (in a textbox) the result as follow.
-------------------------------------------------------------------------------------------------
| Handle ID: 327888 | Class name: SysFader | Window name: SysFader || |
| Handle ID: 5789 | Class name: Winamp v1.x | Window name: Winamp 2.79 || |
| Handle ID: 656116 | Class name: Notepad | Window name: note - Notepad || |
| ... |
| |
--------------------------------------------------------------------------------------------------
But, in point of fact the program shows the result like this:
--------------------------------------------------------------------------------------------------
| Handle ID: 327888 | Class name: SysFader | Window name: SysFader || |
| tification Window || |
| Window || |
| dle ID: 1179922 | Class name: ThunderRT6Main | Window name: projProcGet2|||
| | |
| Class name: Winamp v1.x | Window name: Winamp 2.79 || |
| ctions Tray | Window name: Connections Tray || |
| ... |
| |
--------------------------------------------------------------------------------------------------
If this post is allowed, Please could anybody help me find the solution or forward me to any websites containing good winsock tutorial?
Sincerely yours,

yoz1ris:nice:


----------------ExcerptOfCode------------------

'In Server's (sender) module:
...
If lResult2 <> 0 Then _
strDat = strDat & "Handle ID: " & CStr(hwnd) _
& " | " & "Class name: " & sClassName _
& " | " & "Window name: " & sWndName & " ||" _
& vbCrLf & vbNullChar

frmSend.w2.SendData strDat
...

'In Client's (receiver) module:
...
Private Sub w1_DataArrival(ByVal bytesTotal As Long)
Dim strDat As String
w1.GetData strDat
txtList.SelText = strDat
End Sub
...
------------------------EndOfExcerpt---------------------------


All times are GMT +5.5. The time now is 01:21.