Click here to Skip to main content
15,888,590 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generaldial-up connecion properties (Urgent plz) Pin
aamirsaddiq16-Jul-03 20:45
aamirsaddiq16-Jul-03 20:45 
GeneralFor DB experts only! Pin
lee121216-Jul-03 4:11
lee121216-Jul-03 4:11 
GeneralRe: For DB experts only! Pin
Richard Day22-Jul-03 5:54
Richard Day22-Jul-03 5:54 
GeneralRe: For DB experts only! Pin
pxw16-Aug-03 7:18
pxw16-Aug-03 7:18 
Generaltalk to USB ports Pin
Dev_Calz15-Jul-03 14:19
Dev_Calz15-Jul-03 14:19 
GeneralRe: talk to USB ports Pin
Dave Kreskowiak16-Jul-03 3:38
mveDave Kreskowiak16-Jul-03 3:38 
GeneralAny good up and coming conferences Pin
Aaron Bartell15-Jul-03 6:52
Aaron Bartell15-Jul-03 6:52 
GeneralioctlSocket in VB.NET Pin
Abel15-Jul-03 4:21
Abel15-Jul-03 4:21 
Hello everybody.

I want to use the ioctlsocket winsock function to set non blocking mode to a socket in VB.NET.
I have to use this function because it seems there is no means to create a Net.sockets.socket object from a valid Win32 SOCKET handle (provided by a custom function librairy)

In my code, I alway Have SOCKET_ERROR after ioctlsocket call ... and lastError is set to 10022
Maybe my FIONBIO constant is not correct. Can someone help me ? tks
<br />
// C Computing of FIONBIO :<br />
//#define IOCPARM_MASK    0x7f            /*parameters must be < 128 bytes */<br />
//#define IOC_IN          0x80000000      /* copy in parameters */<br />
//#define _IOW(x,y,t)     (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))<br />
//#define FIONBIO     _IOW('f', 126, u_long) /* set/clear non-blocking i/o */<br />
<br />
    Private Shared ul As IntPtr = Marshal.AllocHGlobal(4)<br />
    Private Declare Function ioctlsocket Lib "ws2_32.dll" (ByVal sck As Long, ByVal cmd As Long, <[In](), Out()> ByVal argp As IntPtr) As Integer<br />
    Public Shared Sub SetNonBlockingMode(ByVal sck As Long)<br />
        'Dim ui As UInt32 = UInt32.Parse(1)<br />
        'Marshal.StructureToPtr(ui, ul, False)<br />
        Marshal.WriteInt32(ul, 0)<br />
        LastErrorValue = 0<br />
        Dim iRes As Long = ioctlsocket(sck, 2147772030, ul) 'Valeur de FIONBIO sur mon PC = 2147772030<br />
        If iRes = SOCKET_ERROR Then<br />
            LastErrorValue = Marshal.GetLastWin32Error()<br />
            Throw New Net.Sockets.SocketException(LastErrorValue)<br />
        End If<br />
    End Sub<br />

GeneralStore multiple XML files Pin
1.21 Gigawatts15-Jul-03 4:06
1.21 Gigawatts15-Jul-03 4:06 
GeneralRe: Store multiple XML files Pin
Ian Darling15-Jul-03 6:03
Ian Darling15-Jul-03 6:03 
GeneralRe: Store multiple XML files Pin
1.21 Gigawatts16-Jul-03 4:31
1.21 Gigawatts16-Jul-03 4:31 
Generaltable primary field name Pin
bpchia14-Jul-03 18:18
bpchia14-Jul-03 18:18 
GeneralRe: table primary field name Pin
Ian Darling15-Jul-03 2:10
Ian Darling15-Jul-03 2:10 
GeneralSub Main Pin
bensoncd14-Jul-03 14:17
bensoncd14-Jul-03 14:17 
GeneralRe: Sub Main Pin
Nick Seng14-Jul-03 15:34
Nick Seng14-Jul-03 15:34 
GeneralRe: Sub Main Pin
bensoncd15-Jul-03 13:43
bensoncd15-Jul-03 13:43 
GeneralRe: Sub Main Pin
Nick Seng15-Jul-03 15:19
Nick Seng15-Jul-03 15:19 
GeneralI just started VB.NET Pin
Anonymous14-Jul-03 11:27
Anonymous14-Jul-03 11:27 
GeneralRe: I just started VB.NET Pin
Nick Seng14-Jul-03 15:31
Nick Seng14-Jul-03 15:31 
Generalcombobox Pin
mhedrick14-Jul-03 6:33
mhedrick14-Jul-03 6:33 
GeneralNew to VB.NET &amp; VB in general Pin
newbie7314-Jul-03 5:46
newbie7314-Jul-03 5:46 
Generalprinting problems Pin
Eng Hong Teo13-Jul-03 20:59
Eng Hong Teo13-Jul-03 20:59 
GeneralON GOTO statement to vc++ Pin
shanila13-Jul-03 3:12
shanila13-Jul-03 3:12 
GeneralRe: ON GOTO statement to vc++ Pin
Hesham Amin13-Jul-03 8:52
Hesham Amin13-Jul-03 8:52 
QuestionHow do I use Left, Right and Mid Functions? Pin
MrGee12-Jul-03 8:49
MrGee12-Jul-03 8:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.