Home All Groups Group Topic Archive Search About

Woking with IntPtr, how can I copy with offset?

Author
5 Jan 2006 5:55 PM
ThunderMusic
Hi,
I have to copy some data to an unmanaged array pointed by an IntPtr. The
thing is Marshal.Copy only offers 4 parameters(not the actual parameters
name but what I understood of them) : Source, srcOffset, Destination(the
IntPtr), Length.

I would need and offset in the destination, something like : Source,
srcOffset, Destination(the IntPtr), dstOffset, Length.

Is there a way I can handle that simply? because I can't just call
Marshal.Copy(Source, srcOffset, Destination+dstOffset, Length). It does not
work.

Does somebody know how to achieve that?

Thanks

ThunderMusic

Author
5 Jan 2006 5:59 PM
Herfried K. Wagner [MVP]
"ThunderMusic" <NO.danlat.at.hotmail.com.SPAM> schrieb:
> I have to copy some data to an unmanaged array pointed by an IntPtr. The
> thing is Marshal.Copy only offers 4 parameters(not the actual parameters
> name but what I understood of them) : Source, srcOffset, Destination(the
> IntPtr), Length.
>
> I would need and offset in the destination, something like : Source,
> srcOffset, Destination(the IntPtr), dstOffset, Length.
>
> Is there a way I can handle that simply? because I can't just call
> Marshal.Copy(Source, srcOffset, Destination+dstOffset, Length). It does
> not work.

'...(..., New IntPtr(Destination + Offset), ...)'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>