468,738 Members | 2,633 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,738 developers. It's quick & easy.

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

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
Jul 19 '05 #1
1 10961
System.Runtime.InteropServices.Marshal.Copy(IntPtr source, byte[]
destination, int start, int length)

"Dave" <dh*****@xrite.remove.com> wrote in message
news:10****************************@phx.gbl...
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

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Ben Voigt | last post: by
8 posts views Thread by =?Utf-8?B?V2hpdG5leSBLZXc=?= | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.