MIDL provides several types of handles. In this way, you can select the handle type that is best suited for your application. (See Encoding Services for additional information on using a primitive handle as a serializing handle.)
Handle characteristics:
The following table summarizes MIDL handle types:
Handle type | Characteristics |
---|---|
Primitive | A handle of the predefined type handle_t. Note that serializing handles (which are not binding handles) are also of the type handle_t. See Serialization Handles for more information. |
Explicit | A handle used as a parameter to the remote procedure. The explicit handle usually appears as the first parameter for compatibility with DCE. |
Implicit | A handle defined in the generated header file as a global variable that is available to the stubs. The developer defines the handle in the ACF only and does not include the handle as a parameter to the remote procedure call. |
User-defined | A handle of the primitive type handle_t that is created by a user-supplied function that converts the user-defined data to the handle. |
Auto | A handle that is automatically generated by the MIDL compiler and managed by the client run-time library. The client stub manages the binding and the handle; the client application does not require any explicit code to manage the binding or the handle. |
Context | A handle that includes information about the state of the server. The context handle is automatically associated with specific user-defined functions on the server. |
Handle characteristics can be combined in several ways to produce such types as explicit primitive, explicit user-defined, implicit primitive, and implicit user-defined handles, depending upon your application needs.