Basic COM  «Prev 

Interface definition language - IDL


The Microsoft Interface Definition Language (MIDL) defines interfaces between client and server programs. Microsoft includes the MIDL compiler with the Platform Software Development Kit (SDK) to enable developers to create the interface definition language (IDL) files and application configuration files (ACF) required for remote procedure call (RPC) interfaces and COM/DCOM interfaces. MIDL also supports the generation of type libraries for OLE Automation.

Where applicable

MIDL can be used in all client/server applications based on Windows operating systems. It can also be used to create client and server programs for heterogeneous network environments that include such operating systems as Unix and Apple. Microsoft supports the Open Group (formerly known as the Open Software Foundation) DCE standard for RPC interoperability.

Developer audience

When using MIDL with RPC, familiarity with C/C++ programming and the RPC paradigm is required. When using MIDL with COM, familiarity with C++ programming and the RPC paradigm as it applies to COM is required, or alternatively, familiarity with OLE Automation model scripting and type libraries is required.

Run-time requirements

The appropriate run-time libraries for using MIDL are included with Windows. The MIDL compiler and the components of the RPC development environment are installed when you install the Windows SDK. For more information, see Using the MIDL Compiler and Installing the RPC Programming Environment.

We import definitions from the IDL file

Every interface definition starts with an attributed section delimited by [,] brackets

The Interface, IMyComInterface, is named. Also, IMyComInterface inherits from IUnknown.

The functions Fx1 and Fx2 are placed in IMyComInterface. Notice that we have not added the virtual keyword or __stdcall attribute.

The `{`, `}` bracket pairs delimit the interface block

The remainder defines interface IYourComInterface containing method Zx1