/Zp switch

The /Zp switch is the same as the /pack option.

midl /Zp packing_level

Switch Options

packing_level

Specifies the packing level of structures in the target system. The packing-level value can be set to 1, 2, 4, or 8.

Remarks

The /Zp switch designates the packing level of structures in the target system. The packing-level value corresponds to the /Zp option value used by the Microsoft C/C++ compiler. For more information, see your Microsoft C/C++ programming documentation.

Specify the same packing level when you invoke the MIDL compiler and the C compiler.

The default packing level used when neither the /Zp nor /pack switch is specified is 8 in all build environments.

Note

Do not use /Zp1 or /Zp2 on MIPS or Alpha platforms and do not use /Zp4 or /Zp8 on 16-bit platforms. Depending on the data type and memory location assigned by the C compiler at run time, this can result in a data misalignment exception on MIPS and Alpha platforms. On MS-DOS platforms, the C compiler will not ensure the alignment at 4 or 8, and so the application may terminate.

 

Examples

midl /Zp4 filename.idl

See also

General MIDL Command-line Syntax

/pack