Pinvoke vs ManagedCode
I was wondering which is better translating a C++ code to C# or Pinvoking it from C# app
which would be better in terms of performa开发者_如何学Gonce and memory and other
If you are running on Windows the third option (the one missing from your list) is best. Leave the code in C++ and compile it with C++/CLI. Then your C# code can consume it directly without need for P/invoke or translation.
There's a good description of how to do this on MSDN.
精彩评论