Apress Publishing has provided TheServerSide.NET with COM and .NET Interoperability for free download.
"COM and .NET Interoperability" covers working with COM components in .NET and .NET components in COM from basic topics like Runtime Callable Wrappers to advanced topics such as manual marshaling of data types between .NET and COM. This book is available in its entirety as a download to registered TSS.NET readers.
The book starts off with an introduction/review of COM concepts such as IUnknown, IClassFactory, and IDispatch interfaces as well as Active Template Library and IDL.
COM servers also support a special sort of COM type termed a class factory (also termed a class object). COM class factories also support the mandatory IUnknown, as well as another standard interface named IClassFactory. This interface allows the COM client to create a given coclass in a language- and locationneutral manner. As you may be aware, it is possible for a COM class factory to support the IClassFactory2 interface (which derives from ClassFactory).
The book moves on to cover the basics of .NET to COM interoperability before building on that with more advanced topics such as handling Variants and manually destroying a COM object.
The COM VARIANT data type is one of the most useful (and most hated) constructs of classic COM. The VARIANT structure is useful in that it is able to assume the identity of any [oleautomation]-compliant IDL type, which may be reassigned after the initial declaration. VARIANTs are hated for much the same reason, given that these dynamic transformations take time. Nevertheless, you are bound to run into a coclass that makes use of this type, and you would do well to understand how it maps into terms of .NET.
"COM and .NET Interoperability" covers working with COM components in .NET and .NET components in COM from basic topics like Runtime Callable Wrappers to advanced topics such as manual marshaling of data types between .NET and COM. This book is available in its entirety as a download to registered TSS.NET readers.
The book starts off with an introduction/review of COM concepts such as IUnknown, IClassFactory, and IDispatch interfaces as well as Active Template Library and IDL.
COM servers also support a special sort of COM type termed a class factory (also termed a class object). COM class factories also support the mandatory IUnknown, as well as another standard interface named IClassFactory. This interface allows the COM client to create a given coclass in a language- and locationneutral manner. As you may be aware, it is possible for a COM class factory to support the IClassFactory2 interface (which derives from ClassFactory).
The book moves on to cover the basics of .NET to COM interoperability before building on that with more advanced topics such as handling Variants and manually destroying a COM object.
The COM VARIANT data type is one of the most useful (and most hated) constructs of classic COM. The VARIANT structure is useful in that it is able to assume the identity of any [oleautomation]-compliant IDL type, which may be reassigned after the initial declaration. VARIANTs are hated for much the same reason, given that these dynamic transformations take time. Nevertheless, you are bound to run into a coclass that makes use of this type, and you would do well to understand how it maps into terms of .NET.