You can do this easily with unsafe code in C#. Something like:

fixed (byte* pBuffer = byteArray)
{
        MyStruct s = *((MyStruct*) pBuffer);
}

-----Original Message-----
From: David B. Bitton [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 10, 2002 12:38 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] CopyMemory (RtlMoveMemory) -- The .NET way


    Our application (VB6) receives a byte array via a TCP conversation.
We then take the byte array, and do a CopyMemory into a UDT.  This has
been a classic way of handling this type of situtation.  Now, I want to
know how I would do this, the .NET way.

How is this done?


--

David B. Bitton
[EMAIL PROTECTED]
www.codenoevil.com

Code Made Fresh DailyT

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to