Companies have spent a decade investing in custom Windows development. .NET developers can't afford to throw that code away. But most books dispose of .NET's interoperability features in just a chapter or two. Finally, though, there's an exhaustive, code-rich guide to .NET legacy interoperability.
At Microsoft, author Adam Nathan was extensively involved in testing .NET's COM Interoperability features. He knows them backward and forward -- including the rough spots.
Nathan begins by concisely explaining the interactions between managed .NET code and "unmanaged" legacy code, and how .NET enables the use of old code while potentially ameliorating some of its problems (e.g., security).
You'll walk through using COM objects and ActiveX controls in ASP.NET pages; marshaling data across unmanaged/managed boundaries; and much more. (The first case study: building a .NET application that uses Word's spellchecker.) There are extensive chapters on imported assemblies, responding to COM events, creating and modifying Interop assemblies; and working with exported type libraries.
Microsoft's official .NET design guidelines do a great job of promoting consistency, predictability, and ease-of-use in the context of .NET languages. But some of those guidelines prevent COM clients from fully utilizing your new code. Nathan shows how to design great .NET software that doesn't straitjacket COM clients.
If most .NET books gloss over COM Interoperability, they do even worse with PInvoke, which lets you access functionality exposed by static entry points instead of COM components. Nathan offers a full section on PInvoke. He also covers three advanced topics in exceptional detail: custom marshaling, manually defining COM types in source code; and directly accessing .NET's interoperability APIs without using the intermediary tools Microsoft provides.
Legacy interoperability with .NET isn't simple, but it is crucial. This book is an unprecedented resource for working developers who need to make it happen. (Bill Camarda)
Bill Camarda is a consultant, writer, and web/multimedia content developer with nearly 20 years' experience in helping technology companies deploy and market advanced software, computing, and networking products and services. He served for nearly ten years as vice president of a New Jerseybased marketing company, where he supervised a wide range of graphics and web design projects. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.