Archive for

Example Custom Marshaler – The Array Marshaler

1. Introduction. 1.1 A very useful .NET feature is the marshaling of managed arrays to unmanaged functions by using the MarshalAsAttribute with the MarshalAsAttribute.Value set to UnmanagedType.LPArray in conjunction with using the SizeParamIndex field. 1.2 The array may even be marshaled in both directions, i.e. to unmanaged code and then back to managed with data … Continue reading