It errors "Type mismatch" on the bold line on "server"VB Code:
Function IsServerOnline() As Long Dim MySocket As Long MySocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) Dim server As String server = "66.66.66.66" ' example ip [b]If (Connect(MySocket, server, Len(server))) = SOCKET_ERROR Then[/b] MsgBox "Cannot Connect to Server", vbCritical, "Error" Unload Me End IsServerOnline = 0 Else MsgBox "Connected", vbInformation End If End Function
What am I doing wrong? (yes I have the API's declared)




Reply With Quote