Chapter 14. .NET Interoperability with COM

IN THIS CHAPTER

Most companies that have been developing with Microsoft development tools have a large investment in their existing systems, especially the business logic they have coded into COM components. Those components are being used by Windows applications and Web applications, and are often used as the workhorse of applications for enforcing business rules and allowing for reusability of those rules across multiple applications.

The .NET Framework provides many benefits, but it is impractical to think that all companies will immediately update all their business logic components to .NET. To address this issue, and the opposite issue of needing to call a new .NET assembly in a COM-based application, Microsoft provides you with an interoperability library that allows .NET to use COM, and COM to use .NET.

Thanks to Microsoft's implementation of interoperability, COM does not know when it is calling .NET, and .NET can easily call COM components. .NET can also make calls out to the Windows API.

As you have read, .NET code that is executing is handled by the .NET Framework and is called managed code. Code not running inside the .NET Framework is called unmanaged code. VB .NET and C# were designed to write managed code because they were built to use the .NET Framework. C++ can write either managed or unmanaged code. Previous versions of VB technically create unmanaged code because VB applications do not use the .NET Framework.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.160.137