Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

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!

0
adg
Asked:
adg
  • 4
  • 3
1 Solution
 
JonFish85Commented:
what is the description for the error?
0
 
JonFish85Commented:
also try using something like this:

Private Sub sck1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
  MsgBox Description
End Sub

to find out if that can trap it...
0
 
adgAuthor Commented:
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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
adgAuthor Commented:
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
0
 
adgAuthor Commented:
That worked.  I'd still like a reference so I can find out more info about this "error".
0
 
adgAuthor Commented:
JonFish85, your comments were helpful - thanks!
0
 
JonFish85Commented:
thanks for the points and especially for the A grade!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now