Share via


com:Interface (com:Extension)

註冊新的 COM 介面。

元素階層

<套件>

    <應用程式>

         <應用程式>

              <擴充功能>

                   <com:Extension>

                        <com:ComInterface>

                             <com:Interface>

Syntax

<com:Interface
    Id = 'An alphanumeric string separated by a period with a value between 1 and 255 characters in length (for example, Foo.Bar or Foo.Bar.1).'
    UseUniversalMarshaler = 'An optional boolean value.'
    ProxyStubClsid = 'An optional GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
    SynchronousInterface = 'An optional GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
    AsynchronousInterface = 'An optional GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.' >

  <!-- Child elements -->
  TypeLib?

</com:Interface>

答案

? 選擇性 (零或一個)

屬性和元素

屬性

屬性 描述 資料類型 必要 預設值
Id 介面識別碼 (IID) 。 以長度介於 1 到 255 (個字元之間的句號分隔的英數位元字串,例如,Foo.Bar 或 Foo.Bar.1) 。 Yes
UseUniversalMarshaler 將此設定為 true,以使用 OLE Universal Marshaler 做為 Proxy 存根。 選擇性布林值。 No
ProxyStubClsid 對應至 ProxyStubClsid32 登錄值。 xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx 格式的選擇性 GUID。 No
SynchronousInterface 另一個介面註冊的識別碼,其中包含參考此註冊的 AsynchronousInterface。 另一個介面必須位於相同的 comInterface 延伸模組中。 xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx 格式的選擇性 GUID。 No
SyncInterface 另一個介面註冊的識別碼,其中包含參考此註冊的 SynchronousInterface。 另一個介面必須位於相同的 comInterface 延伸模組中。 xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx 格式的選擇性 GUID。 No

子元素

子項目 描述
com:TypeLib 介面的類型程式庫。

父元素

父元素 描述
com:ComInterface 宣告 windows.comInterface類型的套件延伸點。 comInterface 延伸模組可能包含三種類型的註冊: InterfaceProxyStubTypeLib

備註

ProxyStubClsid屬性必須參考相同comInterface延伸模組中ProxyStub的識別碼。 ProxyStubClsid 只能用於將實作作為封裝一部分的 Proxy 存根。 若要使用 OLE Universal Marshaler 做為 Proxy 存根,請改用 UseUniversalMarshaler

如果 UseUniversalMarshaler 為 true,介面註冊必須包含 TypeLib

注意

ProxyStubClsidUseUniversalMarshaler 互斥。

規格需求

Item
Namespace http://schemas.microsoft.com/appx/manifest/com/windows10
OS 最低版本 Windows 10版本 1703 (組建 15063)