auto_handle attribute
The [auto_handle] ACF attribute directs the stub to automatically establish the binding for a function that does not have an explicit binding-handle parameter.
Note
This attribute is obsolete and no longer supported. Use of the /robust switch is recommended.
[
auto_handle [, interface-attribute-list]
]
interface interface-name
{
interface-definition
}
Parameters
-
interface-attribute-list
-
Specifies zero or more attributes that apply to the interface as a whole, such as code or nocode. Separate interface attributes with commas.
-
interface-name
-
Specifies the name of the interface.
-
interface-definition
-
Specifies IDL statements that form the definition of the interface.
Remarks
The [auto_handle] attribute appears in the interface header of the ACF. It also appears in the interface header of the IDL file when you specify the MIDL compiler switch /app_config.
When the client calls a function that uses automatic binding and no binding to a server exists, the stub automatically establishes the binding. The binding is reused for subsequent calls to other functions in the interface that use automatic binding. The client application program does not have to declare or perform any processing relating to the binding handle.
When the ACF is not present or does not include the [implicit_handle] attribute, the MIDL compiler uses [auto_handle] and issues an informational message. The MIDL compiler also uses [auto_handle], if needed, to establish the initial binding for a [context_handle].
The [auto_handle] attribute can occur only if the [implicit_handle] or [explicit_handle] attribute does not occur. The [auto_handle] attribute can occur in the ACF or IDL interface header at most once.
Note
You cannot use automatic binding (either with the [auto_handle] attribute, or by default) if you are processing data through pipes.
Examples
[
auto_handle
]
interface MyInterface
{
/* Interface definition goes here*/
}
[
auto_handle,
code
]
interface MyInterface
{
/* Interface definition goes here*/
}
See also