The interface proxy file (name_P.C) is a C file that contains routines equivalent to those in the client stub, server stub, and client and server files of an RPC interface. This file contains implementations of CProxyInterface and CStubInterface classes that are derived from the CProxy and CStub classes of the base interface. For example, an interface named ISomeInterface derived from the IUnknown interface is implemented in the CProxyISomeInterface and CStubISomeInterface classes derived from the CProxyIUnknown and CStubIUnknown classes.
The interface proxy file includes the following sections:
The virtual member functions of this class provide a client application's surrogate entry points for each of the interface functions. These member functions marshal the input arguments into a transmittable form, transmit the marshalled arguments along with information that identifies the interface and the operation, and then unmarshal the return value and any output arguments when the transmitted operation returns.
The virtual member functions of this class provide an object server's surrogate entry points for each of the interface functions. These member functions unmarshal the input arguments, invoke the server's implementation of the interface function, and then marshal and transmit the return value and any output arguments. A CStubInterface class also includes a member function that is invoked by the RPC run-time library when a client application calls one of the interface functions. This routine calls the surrogate routine specified by the RPC message.
Use the /proxy MIDL compiler switch to override the default name of the interface proxy file. The /env and /out switches affect this file.