managedInProcessServer) 中的 com4:Class (
向一或多個類別註冊 Managed 同進程伺服器。
元素階層
<com4:Class>
Syntax
<com4:Class
ThreadingModel = 'A string that can have one of the following values: "Both", "STA", "MTA", "MainSTA", or "Neutral".'
ImplementationClass = '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).'
Virtualization = 'A string that can have one of the following values: "enabled" or "disabled".'
ProgId = '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).'
VersionIndependentProgId = '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).'
AutoConvertTo = 'A GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
InsertableObject = 'A boolean value.'
ShortDisplayName = 'A string with a value between 1 and 40 characters in length.'
Id = 'A GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
DisplayName = 'A string with a value between 1 and 256 characters in length. This string is localizable.'>
<!-- Child elements -->
ImplementedCategories
Conversion
DataFormats
MiscStatus
Verbs
DefaultIcon
ToolboxBitmap32
TypeLib
</com4:Class>
屬性和元素
屬性
屬性 | 描述 | 資料類型 | 必要 | 預設值 |
---|---|---|---|---|
ThreadingModel | 載入 DLL 的執行緒模型。 | 可以具有下列其中一個值的字串: Both、 STA、 MTA、 MainSTA或 Neutral。 | Yes | |
ImplementationClass | 與類別參考相關聯的實作類別。 | 以介於 1 到 255 (個字元長度的句號分隔的英數位元字串,例如,Foo.Bar 或 Foo.Bar.1) 。 | Yes | |
虛擬化 | 指定載入 類別時是否使用虛擬化。 | 可以具有下列其中一個值的字串: 已啟用 或 停用。 | Yes | |
ProgId | 將程式設計識別碼 (ProgID) 與 CLSID 產生關聯。 | 以介於 1 到 255 (個字元長度的句號分隔的英數位元字串,例如,Foo.Bar 或 Foo.Bar.1) 。 | No | |
VersionIndependentProgId | 建立 ProgID 與 CLSID 的關聯。 這個值是用來判斷最新版的物件應用程式。 | 以介於 1 到 255 (個字元長度的句號分隔的英數位元字串,例如,Foo.Bar 或 Foo.Bar.1) 。 | No | |
AutoConvertTo | 指定將指定物件類別自動轉換成新的 物件類別。 | 格式為 xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx 的 GUID。 | No | |
InsertableObject | 表示這個類別是可插入的。 | 布林值。 | No | |
ShortDisplayName | 類別顯示名稱的簡短版本。 | 長度介於 1 到 40 個字元之間的字串。 | No | |
Id | Id 屬性會對應至 CLSID。 | 格式為 xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx 的 GUID。 | Yes | |
DisplayName | 可當地語系化的字串,對應至 CLSID 索引鍵的預設值。 | 長度介於 1 到 256 個字元之間的字串。 這個字串可當地語系化。 | No |
子元素
子項目 | 描述 |
---|---|
ImplementedCategories | 指定 類別所實作的類別。 |
轉換 | 指定應用程式可以讀取和寫入的格式。 |
DataFormats | 指定應用程式所支援的預設和主要資料格式。 |
MiscStatus | 指定如何建立及顯示物件。 |
動詞 | 指定要為應用程式註冊的動詞。 |
DefaultIcon | 提供物件圖示呈現的預設圖示資訊。 |
ToolboxBitmap32 | 識別要用於工具列或工具箱按鈕之 16 x 16 點陣圖的模組名稱和資源識別碼。 |
TypeLib | 類別或介面的類型程式庫。 |
父元素
父元素 | 描述 |
---|---|
com4:ManagedInProcessServer | 向一或多個類別註冊註冊 Managed 同進程伺服器。 |
範例
下列範例示範向 Managed 同進程伺服器註冊多個類別實作。
<com4:ManagedInProcessServer Assembly="Fabrikam.Widgets, Version=10.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxxx" RuntimeVersion="v4.0.30319">
<com4:Class Id="99b9b8fa-2c14-42f7-xxxx-xxxxxxxxxxxx" DisplayName="SimpleWidget" ImplementationClass="Fabrikam.Widgets.SimpleWidget"/>
<com4:Class Id="0057c8be-3c95-4242-xxxx-xxxxxxxxxxxx" DisplayName="SingleThreadedWidget" ImplementationClass="Fabrikam.Widgets.SingleThreadedWidget" ThreadingModel="Apartment"/>
</com4:ManagedInProcessServer>
規格需求
Item | 值 |
---|---|
Namespace | http://schemas.microsoft.com/appx/manifest/com/windows10/4 |
OS 最低版本 | Windows 10 (組建 20348) |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應