com中的列集

列集: 为了将一个接口指针从一个线程传递到同一进程内的另一个线程中。

用到的两个函数: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支持跨套间边界的对象引用列集机制。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值