Copying Memory to an Array

S

Si

Thanks in Advance,

I don't know if I need to copy the memory to an Array (thats what I
would have done it in vb6), I just need to be able to read/access it.

I have a Callback function that is handing me a block of memory -

Function BufferCB(ByVal SampleTime As Double, ByVal pBuffer As IntPtr,
ByVal BufferLen As Integer) As Integer Implements _ISampleGrabberCB.BufferCB
SyncLock Me

Dim BAR() As Byte
ReDim BAR(BufferLen) ' This creates the buffer but I need to copy
' the data from the memory location in pBuffer ' pointer.
End SyncLock
Return 0
End Function


Thanks Again.
 
H

Herfried K. Wagner [MVP]

Si said:
I don't know if I need to copy the memory to an Array (thats what I
would have done it in vb6), I just need to be able to read/access it.

Check out the members of 'System.Runtime.InteropServices.Marshal'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top