I've editted a packetsniffer which i downloaded from planet-source-code.

Basically I'm trying to parse the data coming into the computer
I've used this as the code;
VB Code:
  1. Private Sub TCPDriver_RecievedPacket(IPHeader As clsIPHeader, TCPProtocol As clsTCPProtocol, Data As String)
  2. Debug.Print Data
  3. Debug.Print "-------------"
  4. If InStr(1, Data, "÷") <> 0 Then
  5.         MsgBox Len(Data)
  6.         MsgBox Data
  7.         MsgBox Mid(Data, 1, Len(Data))
  8. End If
The sub and modules themselves are not the problem, as I've used them before, but never had this problem.

Basically, Debug.print is printing out all the data incoming to the computer, and this works 100% fine.
When the If statement is triggered, the first messagebox gives a length of approx 40 something, but when the second messagebox appears, its value is only a few characters long

A sample of what 'Data' could be is
÷1  à dakkonblade   àÜÿjô
If I were to msgbox data, it would return
÷1

The causes a problem, because when I use Instr(1,Data,"à"), it will always return 0.

I really have no idea what could be causing this, as debug.print returns the right value, Len(Data) returns the right value, but msgbox or validation checks are always cut off.

Does anyone have an Idea of what's happening here?