About the author
One of the most important classes to know when porting applications from Win32 to .NET is the Marshal class.
The Marshal class contains many routines to assist in moving memory between Win32 and the CLR, converting data types from .NET to Win32 compatible ones, among others.
The most important among them, would be what I would consider the PtrToStructure, and StructureToPtr static class functions of the Marshal class.
PtrToStructure takes an IntPtr (which is the equivalent of a Win32 Pointer), and converts it to a record in .NET. PtrToStructure doesn't accept as it's parameter, a record. However, it can be coerced to accept a parameter specifying the typeof the object to return, and this can be a record.
StructureToPtr converts a native .NET class or record into a Win32 structure. It does this by taking a record which (most of the time has) Marshal attributes declared on the record, and lays it out accordingly into the memory area specified by an IntPtr.
To be continued...
How to free more space on your home drive by redirecting the location for SDKs in RAD Studio
Learn the command line used to compile System.pas in Delphi
A method to design records so that they're allocated on a specific byte boundary, such as 16 bytes, 512 bytes, 4096 bytes, etc.
Learn why the map is cool in Go!