restricted attribute

The [restricted] attribute specifies that a library, or member of a module, interface, or dispinterface cannot be called arbitrarily.

[
    restricted
    [, other-attributes]
] 
statement-type statement-name 
{
    definitions
};

Parameters

other-attributes

Zero or more MIDL attributes.

statement-type

One of the following: library, module, interface, dispinterface.

statement-name

The identifier by which the software refers to this statement.

definitions

MIDL language elements that define the contents of this statement.

Remarks

This attribute enables you to control access to elements of interfaces, libraries, modules, and dispinterfaces. For example, it can prevent a data item from being used by a macro programmer. You can apply this attribute to a member of a coclass, independent of whether the member is a dispinterface or interface, and independent of whether the member is a sink (incoming) or source (outgoing). A member of a coclass cannot have both the [restricted] and [default] attributes.

Flags

IMPLTYPEFLAG_FRESTRICTED, FUNCFLAG_FRESTRICTED

Examples

[
    uuid(12345678-1234-1234-1234-123456789ABC), 
    version (1.0), 
    restricted
] 
library MyLibrary
{
    // Library definition statements.
};

[propget, restricted] HRESULT MyProc(void);

See also

TYPEFLAGS

library

interface

dispinterface

module

ODL File Syntax

ODL File Example

Generating a Type Library With MIDL