Chapter 15: Unmanaged Code Interoperability


Overview

The Microsoft .NET Framework is an extremely ambitious platform, combining a new language (C#), a managed runtime (the CLR), a platform for hosting Web applications (Microsoft ASP.NET), and an extensive class library for building all types of applications. However, as expansive as the .NET Framework is, it doesn't duplicate all the features that are available in unmanaged code. Currently, the .NET Framework doesn't include every function that's available in the Win32 API, and many businesses are using complex proprietary solutions that they've built with COM-based languages such as Microsoft Visual Basic 6 and Microsoft Visual C++ 6.

Fortunately, Microsoft doesn't intend for businesses to abandon the code base they've built up when they move to the .NET platform. Instead, the .NET Framework is equipped with interoperability features that allow you to use legacy code from .NET Framework applications and even access .NET assemblies as though they are COM components . The recipes in this chapter describe the following:

  • How to call functions exposed by unmanaged DLLs (recipes 15.1 through 15.5)

  • How to use COM components from .NET Framework applications (recipes 15.6 through 15.8)

  • How to use ActiveX controls from .NET Framework applications (recipe 15.9)

  • How to expose the functionality of a .NET assembly as a COM component (recipe 15.10)




C# Programmer[ap]s Cookbook
C# Programmer[ap]s Cookbook
ISBN: 735619301
EAN: N/A
Year: 2006
Pages: 266

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