Making an unmanaged .dll call from C #

How long is typical overhead added by calling a .dll written in C ++ from a C # application using the following syntax?

[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);

Is there a more efficient way to do this?

+5
source share
5 answers

Check out this article on how to improve collaboration performance. What to do and what is best avoided.

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

+7
source

Are you talking about the overhead of calling the native method? If so, I don’t think it matters at all, since there are many such collections in the .NET.NET class libraries.

, , , .

+1

NT, . , .

0

, . , , , , ( ). visual studio , , dll.

0

, , CIL- calli, , , , pinnig / marshalling, , .,

0

All Articles