O'Reilly logo

.NET Programming: A Practical Guide Using C# by Pradeep Tapadiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

.NET supports interoperability with APIs in native DLLs as well as with COM components. The SDK defines a collection of classes under the namespace System.Runtime.InteropServices to support this interoperability.

The ability to access APIs in native DLLs is offered through a mechanism called PInvoke, which offers a great deal of support for marshaling basic datatypes, pointers, and even structures.

The default marshaling options used by the interop marshaler try to make interoperability as seamless as possible. In cases where there is an ambiguity on how a managed type can be marshaled, the .NET Framework defines a mechanism to let the developers provide marshaling hints to the interop marshaler.

The framework also defines a mechanism ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required