local attribute
The [local] attribute specifies to the MIDL compiler that an interface or function is not remote.
[
local
[, interface-attribute-list]
]
interface interface-name
{
}
[
object,
uuid(string-uuid),
local [, interface-attribute-list]
]
interface interface-name
{
}
[ local [, function-attribute-list] ] function-declarator ;
Parameters
-
interface-attribute-list
-
Specifies other attributes that apply to the interface as a whole. The attributes [endpoint], [version], and [pointer_default] are optional. When you compile with the /app_config switch, either [implicit_handle] or [auto_handle] can also be present. Separate multiple attributes with commas.
-
interface-name
-
Specifies the name by which software components can delineate the interface.
-
string-uuid
-
Specifies a UUID string generated by the Uuidgen utility. If you are not using the MIDL compiler switch /osf, you can enclose the UUID string in quotes.
-
function-attribute-list
-
Specifies zero or more attributes that apply to the function. Valid function attributes are [callback]; the pointer attribute [ref], [unique], or [ptr]; and the usage attributes [string], [ignore], and [context_handle]. Separate multiple attributes with commas.
-
function-declarator
-
Specifies the type specifier, function name, and parameter list for the function.
Remarks
The [local] attribute can be applied to individual functions or to the interface as a whole.
When used in the interface header, the [local] attribute allows you to use the MIDL compiler as a header generator. The compiler does not generate stubs for any functions and does not ensure that the header can be transmitted.
For an RPC interface, the [local] attribute cannot be used at the same time as the [uuid] attribute. Either [uuid] or [local] must be present in the interface header, and the one you choose must occur exactly once.
For a COM interface (identified by the [object] interface attribute), the interface attribute list can include the [local] attribute even though the [uuid] attribute is present.
When used in an individual function, the [local] attribute designates a local procedure for which no stubs are generated. Using [local] as a function attribute is a Microsoft extension to DCE IDL. Therefore this attribute is not available when you compile using the MIDL /osf switch.
Note that an interface without attributes can be imported into a base IDL file. However, the interface must contain only datatypes with no procedures. If even one procedure is contained in the interface, a local or UUID attribute must be specified.
Examples
/* IDL file #1 */
[
local
]
interface local_procs
{
void MyLocalProc(void);
}
/* IDL file #2 */
[
object,
uuid(12345678-1234-1234-123456789ABC),
local
]
interface local_object_procs : IUnknown
{
void MyLocalObjectProc(void);
}
/* IDL file #3 */
[
uuid(87654321-1234-1234-123456789ABC)
]
interface mixed_procs
{
[local] void MyLocalProc(void);
HRESULT MyRemoteProc([in] short sParam);
}
See also