General MIDL Command-line Syntax
The MIDL compiler processes an IDL file and an optional application configuration file (ACF) to generate a set of output files. The attributes specified in the IDL file's interface attribute list determine whether the compiler generates source files for an RPC interface or for a custom OLE interface.
midl [command-line-switch [switch-options]] filename
Specifies MIDL compiler command-line switches. Switches can appear in any sequence.
Specifies options associated with each switch. Valid options are described in the reference entry for each MIDL compiler switch.
Specifies the name of the IDL file. This file usually has the extension .idl, but it can have another or none.
The following lists show the default names of the files generated for an IDL file named Name.idl. You can use command-line switches to override these default names. Note that the name of the IDL file can have an extension other than .idl, or no extension at all.
- Client stub (name_c.c)
- Server stub (name_s.c)
- Header file (name.h)
When the object attribute appears in the interface attribute list, the compiler generates the following files for a COM interface:
- Interface proxy file (name_p.c)
- Interface header file (name.h)
- Interface UUID file (name_I.c)
When the local attribute appears in the interface attribute list, the compiler generates only the interface header file, Name.h.
The MIDL compiler provided with Microsoft RPC invokes the C preprocessor as needed to process the IDL file. It does not automatically invoke the C compiler to compile generated files.
The MIDL compiler provided with Microsoft RPC uses a different command-line syntax than the DCE IDL compiler.
The Header File
The header file contains definitions of all the data types and operations declared in the IDL file. The header file must be included by all application modules that call the defined operations, implement the defined operations, or manipulate the defined types.