Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Winsock Control Run Time Error 126

Posted on 2001-09-12
7
Medium Priority
?
374 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 200 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

971 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