Cover Page by Eric Lippert, Mark Michaelis

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

20. Platform Interoperability and Unsafe Code

C# has great capabilities, particularly when paired with the .NET libraries. Sometimes, however, you do need to escape out of all the safety that C# provides and step back into the world of memory addresses and pointers. C# supports this in four ways. The first is through the Windows Runtime (WinRT) API, which is exposing more and more of the operating system functions and making them directly available in C# 5.0. The second way is to go through Platform Invoke (P/Invoke) and calls into APIs exposed by unmanaged DLLs. The third approach is through unsafe code, which enables access to memory pointers and addresses. The last way, which is not covered in this text, is through COM interoperability.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required