/Oi switch

The /Oi and /Oic switches direct the MIDL compiler to use a fully-interpreted marshaling method. The /Oicf switch provides additional performance enhancements.

midl /{Oi | Oic | Oif | Oicf}

Switch Options


Specifies the fully-interpreted method for marshaling stub code passed between client and server.


This switch is obsolete. It is recommended that the /Oicf switch be used in its place.



Specifies the codeless proxy method of marshaling that provides all the features of /Oi and also further reduces the size of the client stub code for object interfaces.


This switch is obsolete. It is recommended that the /Oicf switch be used in its place.


Oif or Oicf

Specifies the codeless proxy method of marshaling that includes all the features provided by /Oi and /Oic but uses a new interpreter (fast format strings) that provides better performance than /Oi or /Oic. This switch includes recent RPC enhancements and is recommended for modern RPC scenarios.


Please note the restrictions related to supporting platforms.

The MIDL 3.0 compiler provides two methods for marshaling code: fully-interpreted ( /Oi, /Oic and /Oicf) and mixed-mode ( /Os). Starting with MIDL version 6.0.359, the MIDL compiler generates /Oicf /robust stubs by default. Some language features are not supported in some modes. In this case, the compiler automatically switches to the appropriate mode and issues a warning.

If performance is a concern, the mixed-mode ( /Os) method can be the best approach. In this mode, the compiler chooses to marshal some parameters inline in the generated stubs. While this results in larger stub size, it offers increased performance.

The fully-interpreted method marshals data completely offline. This considerably reduces the size of the stub code, but results in decreased performance. Also, with the fully-interpreted method, there is a limit of 16 parameters for each procedure. Any procedure containing more than 16 parameters will automatically be processed in /Os mode. Among the interpreted modes, /Oicf offers the best performance and /Oi offers the best backward compatibility.

You may want to use the /Oif option if your application uses MIDL features that were introduced with MIDL 3.0, such as the [wire_marshal] and [user_marshal] attributes. If your application uses pipes you must use the /Oif option; if you specify another mode, the MIDL compiler will switch to /Oif.

To fine-tune the way your stub code is marshaled, Microsoft RPC provides an ACF [optimize] attribute. This attribute is used as an interface attribute or operation attribute to select the marshaling mode for individual interfaces or for individual operations.

Calling Conventions

Stubs generated by the MIDL compiler in the interpreted method using the /Oi, /Oic, or /Oif switches must be compiled as either a stdcall or a cdecl procedure during the C compilation. A PASCAL or Fastcall calling convention will not work. Additionally, the server stub must be compiled as stdcall.


midl /Oi filename.idl

midl /Oic filename.idl

midl /Oif filename.idl

See also



General MIDL Command-line Syntax