local

[ local [, interface-attribute-list] ] interface interface-name

[ object, uuid(string-uuid), local [, interface-attribute-list] ]
     interface
interface-name

[ local [, function-attribute-list] ] function-declarator ;

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 of 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.

 

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

{  void MyLocalObjectProc(void);}

 

/* IDL file #3 */

[uuid(12345678-1234-1234-123456789ABC)]

interface mixed_procs

[local] void MyLocalProc(void);

void MyRemoteProc([in] short sParam);

}

 

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 an OLE 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.

See Also

IDL, /osf, object, uuid