Regarding to the post you edited

sockaddr.sin_addr = 66
sockaddr.sin_addr = 66 ' this just overides the previous 66, therefore you end up with 66 in the end, not "66.66.66.66"...


I did not test it, but I think this is the API that converts from string address to a Long
VB Code:
  1. Public Declare Function inet_addr Lib "ws2_32.dll" (ByVal cp As String) As Long
EDIT, Here's the MSDN help for it MSDN - inet_addr

You have to use it like:
VB Code:
  1. Dim server As sockaddr
  2. server.sin_addr = inet_addr("66.66.66.66")
  3.  
  4. If (Connect(MySocket, server, Len(server))) = SOCKET_ERROR Then
  5.  
  6. '... the rest of the code