Connecting Tech Pros Worldwide Forums | Help | Site Map

Converting IntPtr to byte[]

Brian Harleton
Guest
 
Posts: n/a
#1: Nov 15 '05
Having trouble figuring out the best way to convert an
IntPtr to a byte[] without losing any data. Looks like I
need to use Marshal.PtrToStructure(), but I'm not having
any luck with that.
Any help would be appreciated.

Christoph Schittko [MVP]
Guest
 
Posts: n/a
#2: Nov 15 '05

re: Converting IntPtr to byte[]


Does the IntPtr actaully point to a byte[] or is it something else?

It sounds like you are trying to get the bytes occupied by an object ...

Can you be more specific what you are trying to do, then I can help better.
Christoph
Sofware Architect, .NET Mentor
MS MVP XML .NET

"Brian Harleton" <bharleton@xrite.com> wrote in message
news:10c801c361b3$96b0b830$a501280a@phx.gbl...[color=blue]
> Having trouble figuring out the best way to convert an
> IntPtr to a byte[] without losing any data. Looks like I
> need to use Marshal.PtrToStructure(), but I'm not having
> any luck with that.
> Any help would be appreciated.[/color]


jennyq
Guest
 
Posts: n/a
#3: Nov 15 '05

re: Converting IntPtr to byte[]


Marshal.Copy ?

"Brian Harleton" <bharleton@xrite.com> wrote in message
news:10c801c361b3$96b0b830$a501280a@phx.gbl...[color=blue]
> Having trouble figuring out the best way to convert an
> IntPtr to a byte[] without losing any data. Looks like I
> need to use Marshal.PtrToStructure(), but I'm not having
> any luck with that.
> Any help would be appreciated.[/color]


Closed Thread