PInvoke - Interoperability between C++ and C#

03 March 2014 - C#, Visual Studio

Because of a C# training I had to do recently, I took my existing PInvoke material and brought it up to date. Here are the slides and samples. The material covers the following topics:

  1. C++ basics (e.g. how to debug C++ and C# in a single project?)
  2. Interop basics (DllImport, simple data types, Marshal class, character sets, etc.)
  3. Manual marshaling (IntPtr, C# unsafe code, fixed buffers, etc.)
  4. Advanced marshaling topics (e.g. arrays, callbacks, manual memory management, etc.)

The samples have also been refreshed and I have put them into my GitHub repo.

Slides

You can view the slides here. If you prefer having them as PDF, you can download them here.