Summary

This chapter focused on the methods and techniques available to interoperate with legacy C/C++ unmanaged code that is implemented in DLLs. You learned how to specify the type of marshaling that is required to move your data in the managed world to the unmanaged world using the DllImport attribute. Although many of the samples that were provided were in C#, you saw that it is possible to use these same techniques in many different languages. You learned that with VC++ and the managed extensions it provides, It Just Works (IJW) is an alternative to P/Invoke. Using IJW, you can call unmanaged code without the DllImport attribute. The most significant drawback to using IJW is that you have to explicitly do the marshaling yourself. You learned ...

Get .NET Common Language Runtime 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.