Convert native byte array (pointer) to managed byte[]

D

Dave

We are writing some code to interface to a DLL. The DLL
has a callback method that returns the address of a byte
buffer and the buffer length. I have defined the byte
pointer as an IntPtr.

How do I convert between the IntPtr and my managed byte[]
that I want to copy the data into???

-dave
 
S

Stephen Martin

System.Runtime.InteropServices.Marshal.Copy(IntPtr source, byte[]
destination, int start, int length)
 

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