Logged In: NO

I am still not fully certain of the cause of this but have
managed to narrow down the problem a bit. It appears to
always occur inside ReceivePacket, called from the
Winsock1_DataArrival event in SystemPartner in response to
a call to GetExtendedUserInfo. The problem is intermittent
with a very low frequency so it has taken a while to track
down. Anyway, on one specific occasion, it occured while
executing the line

Buffer.Data(f - 4) = raw(f)

inside the For...Next loop in ReceivePacket. f had value
100, RawLen had value 183. The contents of DataAsString
appeared to be valid data thus far.

This might suggest that the value of RawLen might be
inconsistent with the array bounds. I note that you could
perhaps use the UBound() function (and maybe also LBound())
as an alternative method to determine the array size rather
than passing it as a parameter, though this obviously
doesn't address why RawLen might contain an invalid value
in the first place. (Maybe it is due to one call starting
before the previous call has finished? A bit weird though)

James