471,076 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,076 software developers and data experts.

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 11348
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.