adg
asked on
Winsock Control Run Time Error 126
I'm getting a "Run-time error '126'." on the SendData member of a Winsock control using UDP protocol. I haven't been able to find the documentation for this error. Any ideas what it means? Thanks!
what is the description for the error?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A good suggestion but unfortunately it didn't work. The winsock error event isn't being raised. An "On error goto" does pick up the error but the description is a null string.
ASKER
I found the following code at planetsourcecode.com. It never occured to me to simply ignore the error but it looks like that might be the way to go. Anyone have any info on what this error is about?
'Ignore error 126 which sometimes occurs
On Error GoTo ErrorHandler
udpBroadcast.SendData txtData.Text
Exit Sub
ErrorHandler:
If Err.Number <> 126 Then
MsgBox Err.Description, vbCritical, Err.Number
End If
Resume Next
'Ignore error 126 which sometimes occurs
On Error GoTo ErrorHandler
udpBroadcast.SendData txtData.Text
Exit Sub
ErrorHandler:
If Err.Number <> 126 Then
MsgBox Err.Description, vbCritical, Err.Number
End If
Resume Next
ASKER
That worked. I'd still like a reference so I can find out more info about this "error".
ASKER
JonFish85, your comments were helpful - thanks!
thanks for the points and especially for the A grade!