/env

midl /env { dos | win16 | mac | win32 }

dos
Directs the MIDL compiler to generate stub files, or a type library file, for an MS-DOS environment.
win16
Directs the MIDL compiler to generate stub files, or a type library file, for the 16-bit Microsoft Windows environment such as Microsoft Windows 3.x or Microsoft Windows for Workgroups 3.11.
mac
Directs the MIDL compiler to generate stub files, or a type library file, for the Apple® Macintosh® (680x0) environment.

Note  The MIDL compiler does not generate a server-stub file when you use the /env switch with the dos, win16, or mac options.

win32
Directs the MIDL compiler to generate stub files, or a type library file, for a 32-bit Microsoft Windows environment—either Microsoft® Windows® 95 or Microsoft® Windows NT™.

Examples

midl /env dos filename.idl 
midl /env win32 filename.idl 
 

Remarks

The /env switch selects the environment in which the application runs. The /env switch primarily affects the packing level used for structures in that environment.

Be sure you specify the same packing-level setting for both the MIDL compiler and the C compiler.

The /env switch determines the packing level and other settings as follows:

The /align, /pack, and /Zp switches take precedence over the /env settings.

See Also

General MIDL Command-line Syntax, /pack, /Zp