• Welcome to Valhalla Legends Archive.
 

BNLS Error.....

Started by WinSocks, August 29, 2003, 02:52 PM

Previous topic - Next topic

WinSocks

I did a search to see if there was any posts about what i'm having a problem with and it didn't help me very much.


   Case &H9
       version = Val("&H" & StrToHex(StrReverse(Mid(Data, 8, 4))))
       version = CLng(version)
       Checksum = Val("&H" & StrToHex(StrReverse(Mid(Data, 12, 4))))
       Checksum = CLng(Checksum)
       exeinfo = Mid(Data, 16, Len(Data) - 16)  <----- Error (Invalid Procedure call or argument)
         If BNet.Product = "PX2D" Then
           With PB
               .InsertDWORD &H0
               .InsertbYTE &H2
               .InsertDWORD &H1
               .InsertDWORD servers
               .InsertNTString BNet.Cdkey
               .InsertNTString BNet.Cdkey2
               .SendBNLSPacket &HC
           End With
         Else
           With PB
              .InsertDWORD servers
              .InsertNTString BNet.Cdkey
              .SendBNLSPacket &H1
           End With
         End If


If anyone can make it plain and simple why it does that... i look at other sources with bnls parsing and there isn't anything different......

i declared ExeInfo already...... and i been trying to get help from my friends and they can't figure it out either.

could i possibly be missing something?? or have unessessary code??

UserLoser

#1
i'm guessing the data is empty, or it isn't 16 characters in length, could be from horrible parsing upon recieving data

WinSocks

how would i got about makign sure that it's correct 16 character length?

Camel

Invalid length wont cause that error in VB. My guess is that 'data' hasn't been declared, or is not a string.

WinSocks

ByVal Data As String

i have it declared, if it was just that i would of figured that out long ago......

Camel

Well, if Data is a string, the only thing I can imagine that could cause that error is if exeinfo isn't a string.

Grok

Quote from: Camel on August 29, 2003, 04:51 PM
Invalid length wont cause that error in VB. My guess is that 'data' hasn't been declared, or is not a string.

Camel, about 90% of your posts are nothing but guesses.  If you're going to attempt to help someone, how about actually opening up VB and testing what you're saying?

The answer posted by UserLoser is correct.  When the length of data is less than 16 and used in that Mid() function, VB raises error 5, "invalid procedure call or argument."


Camel

Quote from: Grok on August 30, 2003, 06:03 PMCamel, about 90% of your posts are nothing but guesses.  If you're going to attempt to help someone, how about actually opening up VB and testing what you're saying?

Lazy++

Arki

If your so lazy then why dont you just not waist peoples time and not post?