Solved

Winsock Control Run Time Error 126

Posted on 2001-09-12
7
366 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP question(s) about order of output 9 69
Sorting multiple rows and columns, and count duplicates in Excel 2013 4 88
VB6 ListBox Question 4 50
Problem to Alipay 10 47
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…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

830 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