auto_handle屬性

[auto_handle] ACF 屬性會指示存根自動建立沒有明確系結控制碼參數的函式系結。

注意

此屬性已過時,不再支援。 建議使用 /robust 參數。

 

[ 
    auto_handle [, interface-attribute-list] 
] 
interface interface-name
{
    interface-definition
}

參數

interface-attribute-list

指定適用于所有介面的零個或多個屬性,例如 程式碼nocode。 以逗號分隔介面屬性。

interface-name

指定介面的名稱。

interface-definition

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

備註

[auto_handle]屬性會出現在 ACF 的介面標頭中。 當您指定 MIDL 編譯器參數 /app_config時,它也會出現在 IDL 檔案的介面標頭中。

當用戶端呼叫使用自動系結且伺服器沒有系結的函式時,存根會自動建立系結。 系結會針對使用自動系結之介面中其他函式的後續呼叫重複使用。 用戶端應用程式不需要宣告或執行與系結控制碼相關的任何處理。

當 ACF 不存在或不包含 [implicit_handle] 屬性時,MIDL 編譯器會使用 [auto_handle] 併發出參考訊息。 如有需要,MIDL 編譯器也會使用 [auto_handle],為 [coNtext_handle]建立初始系結。

只有當[implicit_handle][explicit_handle]屬性未發生時,才會發生[auto_handle] 屬性。 [auto_handle]屬性最多可以發生在 ACF 或 IDL 介面標頭中。

注意

您無法搭配 [auto_handle] 屬性使用自動系結 (,或者如果您透過管道處理資料,則預設) 。

 

範例

[
    auto_handle
] 
interface MyInterface 
{ 
    /* Interface definition goes here*/
} 
[
    auto_handle, 
    code
] 
interface MyInterface
{ 
    /* Interface definition goes here*/
}

另請參閱

應用程式組態檔 (ACF)

/app_config

代碼

explicit_handle

coNtext_handle

implicit_handle

nocode