Summary

In this chapter, you learned some of the advanced aspects of using a managed object from an unmanaged client. You learned alternate ways of instantiating a managed object besides the standard COM CoCreateInstance function. Using these techniques, you can instantiate a managed object without having to register the object first or instantiate a managed object that has a parameterized constructor. You also learned how garbage collection complicates object life-cycle management and how to solve some of these problems. You also learned how to call overloaded methods and how to control the class interface that the CCW will expose. I also covered using COM apartments, rich-error information, and Windows Forms controls as ActiveX controls. In ...

Get .NET and COM Interoperability Handbook, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.