com3:ServiceServer) 中的类 (
在 com3:ServiceServer 元素中注册的 Windows 服务中托管的 COM 服务器中定义类注册。
<com3:Class>
XML
<com3:Class
Id = 'A GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
DisplayName = 'An optional string with a value between 1 and 256 characters in length.'
EnableOleDefaultHandler = 'An optional boolean value.'
ProgId = 'An optional alphanumeric string separated by a period with a value between 1 and 255 characters in length (e.g. Foo.Bar or Foo.Bar.1).'
VersionIndependentProgId = 'An optional alphanumeric string separated by a period with a value between 1 and 255 characters in length (e.g. Foo.Bar or Foo.Bar.1).'
AutoConvertTo = 'An optional GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
InsertableObject = 'An optional boolean value.'
ShortDisplayName = 'An optional string with a value between 1 and 40 characters in length.' >
<!-- Child elements -->
ImplementedCategories?,
Conversion?,
DataFormats?,
MiscStatus?,
Verbs?,
DefaultIcon?,
ToolboxBitmap32?
</com3:Class>
?
可选 (零个或一个)
属性 | 说明 | 数据类型 | 必须 | 默认值 |
---|---|---|---|---|
Id | Id 属性对应于 CLSID (HKCR\CLSID{MyGuid}) 。 | 格式为 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 的 GUID。 | 是 | |
DisplayName | 一个可本地化的字符串,对应于 CLSID 键的默认值。 | 值长度介于 1 到 256 个字符之间的可选字符串。 | 否 | |
EnableOleDefaultHandler | 如果 InprocHandler32 键的默认值为“Ole32.dll”,则应将其设置为 true。 否则应省略它。 默认值为 false。 | 可选的布尔值。 | 否 | |
ProgId | 将 ProgID) (编程标识符与 CLSID 相关联。 | 一个可选的字母数字字符串,由句点分隔,其值长度为 1 到 255 个字符, (例如 Foo.Bar 或 Foo.Bar.1) 。 | 否 | |
VersionIndependentProgId | 将 ProgID 与 CLSID 相关联。 此值用于确定对象应用程序的最新版本。 | 一个可选的字母数字字符串,由句点分隔,其值长度为 1 到 255 个字符, (例如 Foo.Bar 或 Foo.Bar.1) 。 | 否 | |
AutoConvertTo | 指定给定对象类到新对象类的自动转换。 | 格式为 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 的可选 GUID。 | 否 | |
InsertableObject | 指示此类是可插入的。 | 可选的布尔值。 | 否 | |
ShortDisplayName | 类显示名称的简短版本。 | 值长度介于 1 到 40 个字符之间的可选字符串。 | 否 |
子元素 | 描述 |
---|---|
ImplementedCategories | 指定由 类实现的类别。 |
转换 | 指定类的读/写权限。 |
DataFormats | 指定支持的默认和main数据格式。 |
MiscStatus | 指定如何创建和显示对象。 |
动词 | 指定要为应用程序注册的谓词。 |
DefaultIcon | 为对象的图标演示文稿提供默认图标信息。 |
ToolboxBitmap32 | 标识要用于工具栏或工具箱按钮表面的 16 x 16 位图的模块名称和资源 ID。 |
父元素 | 描述 |
---|---|
com3:ServiceServer | 将 COM 服务器 (注册到一个或多个类注册,) 托管在 Windows 服务中,使用相应的 desktop6:Service 元素声明。 |
XML
<?xml version="1.0" encoding="utf-8"?>
<Package IgnorableNamespaces="uap com com2 com3 desktop6"
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
xmlns:com2="http://schemas.microsoft.com/appx/manifest/com/windows10/2"
xmlns:com3="http://schemas.microsoft.com/appx/manifest/com/windows10/3">
...
<Applications>
<Application ...>
<Extensions>
<desktop6:Extension Category="windows.service" Executable="ContosoPackagedService.exe" EntryPoint="packagedServiceComServer.service">
<desktop6:Service Name="examplePackagedServiceComServer" StartupType="manual" StartAccount="localService" />
</desktop6:Extension>
<com2:Extension Category="windows.comServer">
<com2:ComServer>
<com3:ServiceServer ServiceName="examplePackagedServiceComServer" DisplayName="ServicePackage public service server"
LaunchAndActivationPermission="O:SYG:SYD:(A;;11;;;WD)(A;;11;;;RC)(A;;11;;;AC)(A;;11;;;AN)S:P(ML;;NX;;;S-1-16-0)">
<com3:Class Id="1BB09D24-6A0F-4C1F-BCB5-FB924324B2F5" DisplayName="CLSID_ContosoPublicServiceNoHandler"/>
</com3:ServiceServer>
<com3:TreatAsClass Id="2DAA3C97-F340-4C0E-B23C-92338974C5E9" DisplayName="CLSID_ContosoPublicServiceTreatAs"
TreatAs="1BB09D24-6A0F-4C1F-BCB5-FB924324B2F5"/>
<com3:ProgId Id="ContosoPublicServiceNoHandler" Clsid="1BB09D24-6A0F-4C1F-BCB5-FB924324B2F5"/>
<com3:ProgId Id="ContosoPublicServiceNoHandler.1" CurrentVersion="ContosoPublicServiceNoHandler"/>
</com2:ComServer>
</com2:Extension>
</Extensions>
</Application>
</Applications>
</Package>
项 | 值 |
---|---|
Namespace | http://schemas.microsoft.com/appx/manifest/com/windows10/3 |
Minimum OS Version | Windows 10版本 2004 (内部版本 19041) |