MIDL Compilation

Given an IDL file, such as Example2.idl, that defines one or more COM interfaces and a type library, the MIDL compiler (Midl.exe) generates the files described in the following table as the default output.

Filename Description
The header file, containing type definitions and function declarations for all of the interfaces defined in the IDL file as well as forward declarations for routines that the stubs call.
The proxy/stub file, which includes the surrogate entry points both for clients and for servers.
The interface ID file, which defines the GUID for every interface specified in the IDL file.
A compound document file that contains information about types and objects.
Contains the data you need to create a proxy/stub DLL.

You use the header file and all of the .c files to create a proxy DLL that can support the interface when used both by client applications and by object servers. You use the interface header file (Example2.h) and the interface ID (Example2_i.c) file when creating the executable file for a client application that uses the interface. You can choose to include the type library file as a resource in your EXE or DLL, or you can ship it as a separate file.

Files Generated for a COM Interface

MIDL Compiler Options