?
Solved

Winsock Control Run Time Error 126

Posted on 2001-09-12
7
Medium Priority
?
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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.

719 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