Solved

Winsock Control Run Time Error 126

Posted on 2001-09-12
7
363 Views
Last Modified: 2013-11-13
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
Comment
Question by:adg
  • 4
  • 3
7 Comments
 
LVL 6

Expert Comment

by:JonFish85
ID: 6478019
what is the description for the error?
0
 
LVL 6

Accepted Solution

by:
JonFish85 earned 50 total points
ID: 6478024
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
 
LVL 3

Author Comment

by:adg
ID: 6478085
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Author Comment

by:adg
ID: 6478160
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
 
LVL 3

Author Comment

by:adg
ID: 6478209
That worked.  I'd still like a reference so I can find out more info about this "error".
0
 
LVL 3

Author Comment

by:adg
ID: 6492649
JonFish85, your comments were helpful - thanks!
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6494596
thanks for the points and especially for the A grade!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now