Navigation:  Programming Cookbook > Creating COM Components > Marshalling >

Type-library Marshalling

Previous pageReturn to chapter overviewNext page

The OLE Automation subsystem (OLEAUT32.DLL) can provide type-library marshalling for all "automation" compatible interfaces for which a type-library is registered. An automation compatible interface supports a limited set of types for its arguments such as VARIANTs, BSTRs, LONGs, etc, but in most cases this set is adequate. IDispatch and "dual" (interfaces derived from IDispatch with late and early bound implementations) are limited to these types anyway, as are many potential clients such as scripting languages and (in practice) Visual Basic. Automation compatible interfaces can be derived directly from IUnknown (i.e. they need not be subclasses of IDispatch).

The MIDL compiler is supplied with the Microsoft Platform SDK (available for free download from Microsoft). To build a type library from IDL one typically uses a simple command line such as:

MIDL /Oicf <idl file>