nonextensible 屬性

[nonextensible]屬性指定IDispatch實作只包含介面描述中列出的屬性和方法,而且無法在執行時間與其他成員擴充。 (自動化預設會假設介面可能會在執行時間新增成員;也就是說,假設它們是 extensible.)

[
    uuid(uuid-number), 
    nonextensible 
    [, optional-attribute-list]
] 
interface | dispinterface interface-name 
{
    interface-definition
}

參數

uuid-number

指定 介面的通用唯一識別碼。

optional-attribute-list

指定零個或多個 MIDL 介面屬性的清單。

interface-name

指定 介面dispinterface的名稱。

interface-definition

指定形成 介面dispinterface定義的 IDL 語句。

備註

您可以將 [nonextensible] 屬性套用至介面或 dispinterface。 不過,介面也必須具有 [雙重][oleautomation] 屬性。

Flags

TYPEFLAG_FNONEXTENSIBLE

範例

library Hello
{
    [
        uuid(12345678-1234-1234-1234-123456789ABC), 
        helpstring("A helpful description."),
        oleautomation, 
        dual, 
        nonextensible
    ] 
    interface IHello : IDispatch
    {
        // Interface definition statements.
    }
}

另請參閱

型別程式庫的內容

dispinterface

使用 MIDL 產生類型程式庫

介面

ODL 檔案語法

oleautomation

TYPEFLAGS