PRB: COM+ Configured Component Does Not Support Custom Marshaling (265672)



The information in this article applies to:

  • Microsoft COM+ 1.0
  • Microsoft COM+ 1.5

This article was previously published under Q265672

SYMPTOMS

A COM component that is configured in COM+ cannot be custom marshaled.

You can custom marshal a COM component:
  • When a COM component uses the Free Threaded Marshaler (FTM).
  • When a COM component is written to "Marshal by Value."
  • When a COM component uses lightweight client-side handler.
A "configured" component is a component that is installed in a COM+ application, while an "unconfigured" component is a component that is not installed in a COM+ application.

CAUSE

The COM+ infrastructure does not use the QueryInterface method for the IMarshal interface from a configured component. This disables custom marshaling and enables standard marshaling instead to marshal the interface.

COM+ does not support custom marshaling because COM+ services are often implemented using policies that are triggered by the standard proxy and stub. Custom marshaled objects do not use the standard proxy and stub; therefore, they bypass services such as role checking, transaction support, and synchronization.

RESOLUTION

In most scenarios, you can use custom marshaling to keep data close to the client and avoid marshaling overhead to get different sub items of the data. You can achieve this by:
  • Passing data as arguments to functions.
  • Making the component that needs to be custom marshaled an unconfigured component.
  • Implementing an application-specific interface that takes the same data you would otherwise pass in the marshaled buffer in the "Marshal by Value" scenario. When the object is created, it is empty. The first thing a user needs to do is pass initialization/constructor data to the object by a method on the application-specific interface.

Modification Type:MajorLast Reviewed:2/20/2002
Keywords:kbDSupport kbprb kbServer KB265672