从C#调用非托管.dll的性能

Mic*_*lli 5 c# c++ interop unmanaged managed

使用以下语法从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);
Run Code Online (Sandbox Code Playgroud)

有更有效的方法吗?

Fad*_*man 7

查看这篇文章,了解如何提高互操作性能.该做什么以及最好避免什么.

http://msdn.microsoft.com/en-us/library/ms998551.aspx