Blittable and Non-Blittable Types in C# and C++ Platform Invocation (P/Invoke)

Blittable and Non-Blittable Types in C# and C++ Platform Invocation (P/Invoke)

In C#, there are certain types that can be used directly between managed and unmanaged code without any conversion; these types are referred to as blittable types. The types are as follows: System.Byte System.SByte System.Int16 System.UInt16 System.Int32 System.UInt32 System.Int64 System.UInt64 System.IntPtr System.UIntPtr System.Single System.Double There are also two special kinds of blittable types. 1. One-dimensional … Read more

C++/C# Interoperability (P/Invoke) and C++/CLI

C++/C# Interoperability (P/Invoke) and C++/CLI

Previous articles have provided a detailed explanation of the data marshaling type issues between C++ and C#, that is, between managed and unmanaged platforms.This article illustrates with data types and simple examples; other more complex business logic can be extended and promoted based on this foundation.There are generally two common methods to call C++ methods: … Read more