| title |
restricted | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
language-reference |
| f1_keywords |
|
| dev_langs |
|
| helpviewer_keywords |
|
| ms.assetid |
504a96be-b904-4269-8be1-920feba201b4 |
| caps.latest.revision |
9 |
| author |
mikeblome |
| ms.author |
mblome |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
Specifies that a member of a module, interface, or dispinterface cannot be called arbitrarily.
[ restricted(
interfaces
) ]
interfaces
One or more interfaces that may not be called arbitrarily on a COM object. This parameter is only valid when applied to a class.
Remarks
The restricted C++ attribute has the same functionality as the restricted MIDL attribute.
The following code shows how to use the restricted attribute:
// cpp_attr_ref_restricted.cpp
// compile with: /LD
#include "windows.h"
#include "unknwn.h"
[module(name="MyLib")];
[object, uuid("00000000-0000-0000-0000-000000000001")]
__interface a
{
};
[object, uuid("00000000-0000-0000-0000-000000000002")]
__interface b
{
};
[coclass, restricted(a,b), uuid("00000000-0000-0000-0000-000000000003")]
class c : public a, public b
{
};
|
|
| Applies to |
Interface method, interface, class, struct |
| Repeatable |
No |
| Required attributes |
coclass (when applied to class or struct) |
| Invalid attributes |
None |
For more information about the attribute contexts, see Attribute Contexts.
IDL Attributes
Interface Attributes
Method Attributes