Hi,
Your code tries to copy 4 bytes of data from the location pointed by IntPtr
(this.Hwnd).
If you want to copy the IntPtr value (not the data it points) you could use
such approach:
byte[] data = new byte[14];
int ptrValue= this.Hwnd.ToInt32();
data[0] = (byte)ptrValue;
data[1] = (byte)ptrValue >> 8;
data[2] = (byte)ptrValue >> 16;
data[3] = (byte)ptrValue >> 24;
--
Andrew Gnenny
pulsar2003@/no-spam/email.ru (Please remove /no-spam/ for reply)
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Juan Irigoyen" <ju***********@ono.com> wrote in message
news:zr*********************@news.ono.com...
I have the next code
byte[] data = new byte[14];
Marshal.Copy(this.Hwnd, data, 0, 4);
this code compiled well, but when i execute the code receive a error.
How can copy this.Hwnd (Handle of MessageWindow type IntPtr) to the first
4 bytes in data ?
Thanks.