Chapter 13. COM and Windows Interoperability
Anyone who has ever done a significant amount of work with COM (Component Object Model) knows that the intentions of the standard were great, but the implementation fell short of the desired solution.
The goal of COM was to create a solution that would enable developers to create separate, self-contained components that could then be employed by developers using different programming languages in other environments. The actual solution did indeed provide that framework, but that framework has many limitations. The .NET Framework removes quite a few of those limitations.
It would be extremely easy for us to assume that COM is dead and that we don't need to concern ourselves with it. Unfortunately, COM is still alive and kicking, and must be dealt with whether we like it or not. A considerably large number of COM objects are still active and in use, so one goal of this chapter is to show you how to interact with those COM components.
In addition to interacting with COM, you must be able to interact with the underlying operating system as well as other DLLs that are not COM libraries (yes, they do actually exist). This chapter will take you through an examination of OS and DLL interoperability through a feature of .NET called platform invoke.
The topic of COM interoperability is one that can consume a book on its own. The information contained in this chapter should be enough to get you going, but will skip some of the low-level implementation details to avoid bogging you down and diluting the big picture.
WHAT YOU NEED
COM AND WINDOWS INTEROPERABILITY AT A GLANCE