|
-
Sep 4th, 2005, 02:44 PM
#1
Thread Starter
Hyperactive Member
Runtime Error '6' "Overflow" Resolved
Can any1 explain this error without seeing the coding ?
The code isn't mine is an example. I think its a winsock error. Can any1 help?
Last edited by Ricky1; Sep 4th, 2005 at 03:34 PM.
-
Sep 4th, 2005, 02:58 PM
#2
Re: Runtime Error '6' "Overflow"
An overflow error is usually because you try to (for example) assign a number to an integer but the number is to large to fit in the 16-bit signer integer type VB is using. Other then that, it's very hard without seeing any code to determent what the problem is.
-
Sep 4th, 2005, 03:00 PM
#3
Re: Runtime Error '6' "Overflow"
If you try to use a number that's bigger than 32678 in an INTEGER, it will produce an OVERFLOW condition because of the size limit for INTEGER.
It would help to see the code, with the error line in order to tell you exactly why it happened.
-
Sep 4th, 2005, 03:16 PM
#4
Thread Starter
Hyperactive Member
Re: Runtime Error '6' "Overflow"
VB Code:
Private Sub tmrCheckIfClosed_Timer()
'// Assign the list status to the list count
lblCountUsernames.Caption = lstUsernames.ListIndex + 1 & "/" & lstUsernames.ListCount
lblCountPasswords.Caption = lstPasswords.ListIndex + 1 & "/" & lstPasswords.ListCount
lblCountProxys.Caption = lstProxys.ListIndex + 1 & "/" & lstProxys.ListCount
lblCountServers.Caption = lstServers.ListIndex + 1 & "/" & lstServers.ListCount
Dim intIndex As Integer
For intIndex = 1 To Val(cboSockets.Text)
'// Check for closed sockets (0, sckClosed)
If wskSendLogin(intIndex).State = 0 Then
'// Disable the timeout timer
tmrTimeout(intIndex).Enabled = False
Dim strHost As String, intPort As Integer
'// Split the host and port from the proxy
strHost = Split(strProxy(intIndex), ":")(0)
[COLOR=Red] intPort = Split(strProxy(intIndex), ":")(1)[/COLOR]
'// Close the socket
wskSendLogin(intIndex).Close
'// Assign the host and port to the socket
wskSendLogin(intIndex).RemoteHost = strHost
wskSendLogin(intIndex).RemotePort = intPort
'// Request Connection
wskSendLogin(intIndex).Connect
'// Enabled the timeout timer
tmrTimeout(intIndex).Enabled = True
End If
Next intIndex
End Sub
it errored on this proxy 12.162.2.193:65208
assuming what you said because 65208 if more then 32678.
How i correct this ?
I tried Dim intIndex As Long instead of Integer, still errored.
-
Sep 4th, 2005, 03:25 PM
#5
Re: Runtime Error '6' "Overflow"
intPort has to be a long. This worked fine.
VB Code:
Private Sub Form_Load()
Dim strProxy As Long
Dim str$
Dim x$, y As Long
str = "12.162.2.193:65208"
x = Split(str, ":")(0)
y = Split(str, ":")(1)
MsgBox x & " " & y
End Sub
-
Sep 4th, 2005, 03:26 PM
#6
Re: Runtime Error '6' "Overflow"
Change the type of intPort to be a Long instead of an Integer.
-
Sep 4th, 2005, 03:33 PM
#7
Thread Starter
Hyperactive Member
Re: Runtime Error '6' "Overflow"
ooooo
didn't see that bit.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|