C++
Interop, also known as “It Just Works”, is only available if you
are using C++/CLI. It is my preferred way of accessing legacy C/C++
code. The basic idea is that things should work as they have always
worked before .NET came along. In other words, if you want to access
functions within a DLL from C++/CLI, you perform the same steps as if
you were using Visual C++ 6.0.
To
illustrate how this is done, suppose you have access to a legacy
library packaged in a DLL called MathDLL.dll. This is the same
library that I used earlier to illustrate how to use P/Invoke to
access functions in a DLL.
Now
suppose you use Visual Studio 2005 to create a ne ...