/Oi

midl /{Oi | Oic | Oif | Oicf}

/Oi
Specifies the fully-interpreted method for marshalling stub code passed between client and server.
/Oic
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.
/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.

Please note the restrictions related to supporting platforms, below.

Examples

midl /Oi filename.idl 
midl /Oic filename.idl
midl /Oif filename.idl
 

Remarks

The MIDL 3.0 compiler provides two methods for marshalling code: fully-interpreted (/Oi, /Oic and /Oif) and mixed-mode (/Os). Mixed-mode is the 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 marshall 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, /Oif offers the best performance and /Oi offers the best backward compatibility.

If your application uses OLE object interfaces and if it will never run on a version of Microsoft Windows NT earlier than 3.51, you can reduce the size of your client stub code for object interfaces by using the /Oic option. With this option the MIDL compiler does not generate any client-side stub code. Since object interface calls are through vtable pointers, the compiler generates the proper vtable structures and the application calls the stubs through them.

If your application will be run only on Microsoft Windows NT 4.0 or later, you can use the faster /Oif option. Specifically, 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 marshalled, Microsoft RPC provides an ACF optimize attribute. This attribute is used as an interface attribute or operation attribute to select the marshalling 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.

Supporting Platforms

/Oi is supported on Windows NT 3.5 or later and Windows 95
/Oic is supported on Windows NT 3.51 or later and Windows 95
/Oif is supported on Windows NT 4.0.

See Also

General MIDL Command-line Syntax, /Os, optimize, /no_format_opt