使用以下语法从 C# 应用程序调用以 C++ 编写的 .dll 会增加多长时间的典型开销?
[DllImport("abc.dll", EntryPoint = "xcFoo", CallingConvention = CallingConvention.Cdecl)]
public extern static Result Foo(out IntPtr session,
[MarshalAs(UnmanagedType.FunctionPtr)]ObjectCallback callback,
UInt64 turnKey,
string serverAddress,
string userId,
string password);
有没有更有效的方法呢?
最佳答案
查看这篇关于如何提高互操作性能的文章。该做什么以及最好避免什么。
关于c# - 从 C# 调用非托管 .dll 的性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2375622/