Performance differences between P/Invoke and C++ Wrappers
问题 In the process of learning P/Invoke, I asked this previous question: How to P/Invoke when pointers are involved However, I don't quite understand the implications of using P/Invoke in C# over creating a wrapper in Managed C++. Creating the same DLL using P/Invoke in C# definately resulted in a cleaner interface since I could use DLLImport on an embedded resource, but would a Managed C++ wrapper for a native DLL, where I do the marshaling myself, have better performance? 回答1: C++ wrapper