Interoperability Facilities

No matter how great the introduction of a new development platform and runtime environment is, the capability to interoperate with existing code is key to the success of the new technology. This is no different for the .NET Framework, so a big investment was made to ensure existing code could work together with the new platform.

One piece of the interoperability stack is called Platform Invoke, or P/Invoke, which enables calling native functions exported by DLLs. P/Invoke is typically used to call into operating system functions that haven’t been exposed (yet) through the managed code libraries.

Note: P/Invoke for the Masses

Getting P/Invoke to work can require intimate knowledge of memory layout, conversions between ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.