/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:

    When dos is specified, _ _far precedes pointer declarations in the generated header file, and the stub files use packing-level 2 for all types involved in remote operations.

    When win16 is specified, _ _far precedes pointer declarations in the generated files, stub files use C-compiler packing-level 2 for all types involved in remote operations, and _ _export is applied to callback stubs on the client side. You must compile the stubs with the /GA option.

    When win32 is specified, generated stubs use C-compiler packing-level 8 for all types involved in remote operations.

    When mac  is specified, the stub files use packing level 2 for all types involved in remote operations. The mac environment does not support object interfaces. 

 

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

See Also

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