On 31 Aug 2004, at 15:42, Thomas Reed wrote:
What routine are you calling, and what does your code look like? I
have a number of callback routines that are defined to return
MemoryBlocks, and they work just fine. I'd be extremely surprised if
you couldn't use MemoryBlock as a parameter type in a callback as
well.
I looked at Jon's previous post as he suggested. I found that i was
missing the line mb = mb.Ptr(0), but these make the MemoryBlock empty.
Here's my code. It's a callback for the libpcap packet capturing
library, it fires when a packet is captured. Any Ideas?
Sub got_packet(Args As Integer, Header As Integer, Packet As Integer)
Dim head As New MemoryBlock(1500)
Dim pkt As New MemoryBlock(1500)
Dim head_str, pkt_str As String
head.long(0) = Header
pkt.long(0) = Packet
head = head.Ptr(0)
pkt = pkt.Ptr(0)
head_str = head.StringValue(0, head.Size)
pkt_str = pkt.StringValue(0, pkt.Size)
head_str = ReplaceAll(head_str, Chr(0), "")
pkt_str = ReplaceAll(pkt_str, Chr(0), "")
System.DebugLog " Header: " + head_str + " Packet: " + pkt_str
End Sub
--
Charlie Boisseau
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|