Using C++ Interop (Implicit PInvoke) - 0 views
-
C++ Interop is recommended over explicit PInvoke because it provides better type safety, is typically less tedious to implement, is more forgiving if the unmanaged API is modified, and makes performance enhancements possible that are not possible with explicit PInvoke.
-
C++ Interop allows COM components to be accessed at will and does not require separate interop assemblies
-
Because it is the language of the native APIs, Visual C++ has a special status on Windows which makes it the best language for interacting with the platform APIs -- whether those are pure C++ APIs or COM components. This is partly due to the fact that unlike other .NET languages, Visual C++ allows managed and unmanaged code to exist in the same application and even in the same file ... allowing integration with existing apps and platform APIs that is just not possible in other .NET languages.