列集: 为了将一个接口指针从一个线程传递到同一进程内的另一个线程中。
用到的两个函数:CoMarshalInterface和CoUnmarshalInterface.
CoMarshalInterface
Writes into a stream the data required to initialize a proxy object in some client process. The COM library in the client process calls the CoUnmarshalInterface function to extract the data and initialize the proxy. Before calling CoUnmarshalInterface, seek back to the original position in the stream. CoMarshalInterface can marshal only interfaces derived from IUnknown.
CoUnmarshalInterface
Initializes a newly created proxy using data written into the stream by a previous call to the CoMarshalInterface function, and returns an interface pointer to that proxy.
列集可以通过函数CoMarshalInterface函数来完成,当调用CoMarshalInterface第一次为对象进行列集时会为对象建立一个存根管理器,而以后对同一个对象的其他接口列集时,就不会再建一个存根管理器.
进程具有一个或者多个套间,任何一个线程在某一时刻只能在一个套间种运行。
每个COM对象只能属于一个套间。为了使每个套间之间能够进行通信。
COM支持跨套间边界的对象引用列集机制。