Getting error while using WSAStartup method
-
Hi I am facing problem while using windows API in VB.net 2005. This is the code i am using.
Private Structure WSADATA Dim wVersion As Short Dim wHighVersion As Short Dim szDescription() As Byte Dim szSystemStatus() As Byte Dim iMaxSockets As Short Dim iMaxUdpDg As Short Dim lpszVendorInfo As Integer Public Sub Initialize() ReDim szDescription(WSADescription_Len) ReDim szSystemStatus(WSASYS_Status_Len) End Sub End Structure Private Const WS_VERSION_REQD As Short = &H101S Dim WSAD As New WSADATA Dim iReturn As Short iReturn = WSAStartup(WS_VERSION_REQD, WSAD)------>This statement is returning an error saying that "System.AccessViolationException was unhandled Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt.""
Please give the suggestions . Thanks , Chaitanya