Chapter 14. Interoperability

for RuBoard

Microsoft .NET is a powerful platform, and there are many advantages in writing a new application within the .NET Framework. However, a typical application is not a world unto itself, but is built from legacy components as well as new components , and interoperability is very important. We discussed one kind of interoperability in Chapter 11 in connection with Web Services. Using the SOAP protocol it is possible for .NET applications to call Web Services on other platforms, including Unix, mainframes, and mobile devices.

In this chapter we will look at another kind of interoperability, the interfacing of managed and unmanaged code running under Windows. The dominant programming model in modern Windows systems is the Component Object Model, or COM. There exist a great many legacy COM components, and so it is desirable for a .NET program, running as managed code, to be able to call unmanaged COM components. The converse situation, in which a COM client needs to call a .NET server, can also arise. [1] Apart from COM, we may also have need for a .NET program to call any unmanaged code that is exposed as a DLL, including the Win32 API. The .NET Framework supports all these interoperability scenarios through COM Interoperability and the Platform Invocation Services or PInvoke.

[1] COM interop is the only mechanism provided for unmanaged code to call managed code.

In this chapter we assume that you understand the concepts behind the legacy technologies.

for RuBoard


Application Development Using C# and .NET
Application Development Using C# and .NET
ISBN: 013093383X
EAN: 2147483647
Year: 2001
Pages: 158

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net