开发者

Pinvoke vs ManagedCode

开发者 https://www.devze.com 2023-04-13 09:39 出处:网络
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 otherIf you are running on Windows

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消