DEPRECATED: How to Configure COM Server to communicate with a COM Client in a different Container

10/07/2019 Cliff Hobbs   ID: 339274

Important

This article applies to Cloudhouse Containers created prior to to the 1903 release. See How to Configure COM communications when the COM Server and COM Client components are running in different Containers for details of how to configure COM in Containers from the 1903 release onwards.

Overview

Applications that require client and server COM components to run in different Containers on the same desktop or server require the <Feature>COMVirtualization</Feature> to be enabled and additional configuration in the Client's Container.

Step-by-step process

Enable <Feature>COMVirtualization</Feature> in both the Containers. In the following examples, the ServerContainer is the application Container running the COM Server, and the ClientContainer is the application container running the COM Client. The additional configuration needs to be added to the ClientContainer, in order for it to communicate with the COM Server. The COM Server container must be run first, in order to register the Server's Virtual ID (VID) and identify the CLSID (use the AAV logs) that is required in the ClientContainer's configuration.  

The Server's Virtual ID needs to be registered, so that when the app uses APIs associated with the CLSID, for example, 388C7181-50E7-4959-BB46-CE8C75D9B90B, then AAV will redirect the CLSID to the virtual one.

With PackageID Example

Modify the configuration of the ClientContainer. If the PackageID is specified in the AAV element, when the app starts using COM related APIs associated with the specified CLSID, for example, 388C7181-50E7-4959-BB46-CE8C75D9B90B, AAV will change the CLSID to a virtual one generated using the external package id so that it is unique. 

<AAV PackageId="ClientContainer">
 <COM>
    <CLSID ID="{388C7181-50E7-4959-BB46-CE8C75D9B90B}" ExternalPackageId="ServerContainer" />
 </COM>
</AAV>

No PackageID Example

If the PackageID is not specified, the feature will generate a VID. However, there is no guarantee it will be a unique ID.

<AAV>
 <COM>
  <CLSID ID="{388C7181-50E7-4959-BB46-CE8C75D9B90B}" ExternalPackageId="ServerContainer" />
 </COM>
</AAV>

Excluding a CLSID from COMVirtualization

If the CLSID element includes the parameter Excluded="True", then COMVirtualization will not virtualize this CLSID.

<COM>
  <CLSID ID="{388C7181-50E7-4959-BB46-CE8C75D9B90B}" ExternalPackageId="ServerContainer" Excluded="True" />
</COM>

Registering COM Server for Single-Use

The COM Server's connection can be restricted to accepting only a single client connection with the ConnectionType="SingleUse" parameter.

<AAV PackageId="ServerContainer">
 <COM>
  <CLSID ID="{388C7181-50E7-4959-BB46-CE8C75D9B90B}" ExternalPackageId="ClientContainer" />
    <Registration ConnectionType="SingleUse" />
  </CLSID>
 </COM>
</AAV>

Common Errors

If COMVIrtualization is enabled, and AAV includes the CLSID and the ExternalPackageID, then AAV will log an error if the server is not started. This is because the VIrtualID has not been registered for the ServerContainer and the Client cannot find it when it attempts to connect.

<AAV PackageId="ClientContainer">
 <COM>
  <CLSID ID="{388C7181-50E7-4959-BB46-CE8C75D9B90B}" ExternalPackageId="ServerContainer" />
 </COM>
</AAV>


Source:
Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support