Best Practices for Wrapping Native Code

image At our talk on Framework Design Guidelines at the PDC, Krzysztof and I were asked about resources for wrapping a native code library in a nice managed code framework. 

This is an extremely common pattern.  Organizations frequently have large "heritage" investments in C\C++\COM code and now they need to expose that functionality is way that is productive and familiar to .NET developers.   Wrapping the native functionality in a well-designed managed library maximizes the productivity of the breadth of .NET developers. 

I promised to blog a few resources on how to best accomplish this. 

Jesse Kaplan recent PDC talk is relevant: Managed and Native Code Interoperability: Best Practices

CLR Inside Out: Marshaling between Managed and Unmanaged Code
Yi Zhang and Xiaoying Guo - January 2008
Marshaling is an important part of .NET interop. It allows you to call into unmanaged code from managed code. This column will help you get started.

CLR Inside Out: Introduction to COM Interop
Thottam R. Sriram - January 2007
The CLR allows seamless interactions between Microsoft .NET applications and COM. But how, exactly? The CLR team knows.

In addition, Jesse will have a great article in MSDN magazine in Feb 2009.. you should check it out.