大网数据广告活动
Windows 系统接口

MIDL Compiler

· 52CE 我爱测

The MIDL compiler processes an IDL file to generate a type library and output files. The type of output files generated by the MIDL compiler depends on the attributes specified in the IDL file's interface attribute list.

The MIDL compiler processes an IDL file to generate a type library and output files. The type of output files generated by the MIDL compiler depends on the attributes specified in the IDL file's interface attribute list.

If the attribute list contains the [object] keyword, the MIDL compiler generates COM interface output files: an interface proxy file, an interface header file, and a globally unique identifier (GUID) file for the interface. If the IDL file contains a library statement, MIDL generates a type library file with the .tlb file name extension. If there are any interfaces in the IDL file that do not have the [object] keyword and are not enclosed in a library statement, the MIDL compiler generates interface output files appropriate for remote procedure calls (RPCs): a client stub file, a server stub file, and a header file. For more information, see the topics Interface Definitions and Type Libraries and Generating a Type Library with MIDL.

To generate a type library and output files from an IDL file:

  • From the command prompt, run

    midl filename

    where filename is the name of the IDL file.

The MIDL compiler also supports several optional parameters. For a complete list, see "MIDL Command-Line Reference" in the Visual C++ documentation, or run the following command line:

midl /?

Related topics

Microsoft Interface Definition Language

Translating to C++

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。