什么是线程编组COM接口的首选方法? [英] What is the preferred method of marshalling COM interfaces across threads?

查看:266
本文介绍了什么是线程编组COM接口的首选方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与CoMarshalInterThreadInterfaceInStream和CoGetInterfaceAndReleaseStream相比,使用GIT的利弊是什么?



有很多理由希望使用一种方法

MSDN


如果您在一个进程中的
公寓之间多次解开一个接口
指针,您可以使用
IGlobalInterfaceTable接口。


除此之外,我会说它是主要是偏好问题。


What are the pros/cons of using the GIT as opposed to CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream for marshalling COM interfaces across threads?

Are there strong reasons for preferring one method over the other, or is it more a matter of personal preference?

解决方案

From MSDN:

If you are unmarshaling an interface pointer multiple times between apartments in a process, you might use the IGlobalInterfaceTable interface. With other techniques, you would have to remarshal each time.

Besides that, I would say it's mostly a matter of preference.

这篇关于什么是线程编组COM接口的首选方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆