Link to home
Start Free TrialLog in
Avatar of adg
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!

Avatar of JonFish85
JonFish85

what is the description for the error?
ASKER CERTIFIED SOLUTION
Avatar of JonFish85
JonFish85

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adg

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.
Avatar of adg

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
Avatar of adg

ASKER

That worked.  I'd still like a reference so I can find out more info about this "error".
Avatar of adg

ASKER

JonFish85, your comments were helpful - thanks!
thanks for the points and especially for the A grade!