OOPortal 





Basic COM  «Prev  Next»
Lesson 7 Interface definition language - IDL
Objective Describe a COM interface using IDL.
In previous lessons, we examined the binary requirements of a COM method and interface; how all COM interfaces implement IUnknown functions:
QueryInterface, AddRef, and Release; and how to use C++ to define a COM interface. This lesson will introduce IDL(the interface definition language) and how to use IDL to define a COM interface.

IDL
Separating interface specification from implementation is a standard development practice. This allows designers and developers to study the interface design and interactions before jumping into implementation. Several industry-standard tools and techniques exist to assist with interface specification. IDL can be used to specify COM interfaces and generate header files containing C++ class definitions that implement COM interfaces.
The following Slideshow steps through an IDL file called IMyComInterface.idl. It contains the definition of interface IMyComInterface, the same interface we discussed in the previous lesson, and IYourComInterface.
Import Definitions from Idl
The guidgen tool can generate this format. To use this tool, select Registry Format, copy into the clipboard by clicking the Copy button, paste into the UUID attributes, and remove the curly brackets ({}).