Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSAStartup dll error

Status
Not open for further replies.

williad4

Technical User
Apr 6, 2005
5
US
I am trying to initialize sockets in my code with the following:

Private Declare Function WSAStartup Lib "WSOCK32.DLL" (ByVal wVersionRequired As Long, ByVal lpWSADATA As WSADATA) As Long

Public Const WS_VERSION_REQD As Long = &H101S


Public Function SocketsInitialize() As Boolean
Dim WSAD As WSADATA
SocketsInitialize = WSAStartup(WS_VERSION_REQD, WSAD) = ICMP_SUCCESS
If SocketsInitialize = False Then
MsgBox(Err.LastDllError)
End If
SocketsInitialize = True
End Function

The WSAStartup fails with the err.lastdllerror code returned is 126. Does anyone have any idea what I am doing wrong? This worked in VB6 but I am now running VB.net.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top