次の方法で共有


nonextensible

IDispatch 実装に、インターフェイスの説明に記載されているプロパティとメソッドのみが含まれ、実行時にメンバーを追加して拡張できないことを指定します。

構文

[nonextensible]

解説

nonextensible C++ 属性には、nonextensible MIDL 属性と同じ機能があります。

nonextensible を使用する場合は、oleautomation 属性も必要です。

次のコードは、nonextensible 属性の使用方法を示しています。

// cpp_attr_ref_nonextensible.cpp
// compile with: /LD
#include "unknwn.h"
[module(name="ATLFIRELib")];
[export] typedef long HRESULT;

[dual, nonextensible, ms_union, oleautomation,
uuid("00000000-0000-0000-0000-000000000001")]
__interface IFireTabCtrl
{
   HRESULT procedure (int i);
};

必要条件

属性コンテキスト Value
適用対象 interface
反復可能 いいえ
必要な属性 dualoleautomation または dispinterface
無効な属性 なし

属性コンテキストの詳細については、「 属性コンテキスト」を参照してください。

関連項目

IDL 属性
インターフェイス属性