NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Preserving Object Identity

An individual RCW may appear to implement several interfaces. When the RCW is cast from one interface to another, internally the wrapper makes a matching QueryInterface call to the classic COM server. If the Query succeeds, the returned interface is cached within the wrapper. All calls on the wrapper are delegated to the underlying object through interfaces it exposes. Regardless of whether the RCW is created early bound, late bound, or even in response to a method call, there will never be more than one instance of the RCW for each instance of the underlying COM object. The RCW preserves the identity of the underlying COM object by comparing the objects IUnknown interface to determine whether the same object is exposing two different interfaces. Therefore, each RCW wraps a unique IUnknown interface.