How do you call unmanaged methods from your .NET code through PInvoke?

Q

How do you call unmanaged methods from your .NET code through PInvoke?

✍: Guest

A

Supply a DllImport attribute. Declare the methods in your .NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you’re just providing declarations for method signatures.

2014-12-08, 1387👍, 0💬