What is the preferred method of marshalling COM in

2019-04-08 20:42发布

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?

2条回答
The star\"
2楼-- · 2019-04-08 20:52

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.

查看更多
疯言疯语
3楼-- · 2019-04-08 20:52

You need a copy of Essential COM by Bon Box, when I used to work with COM, I would reach for Don's book whenever I had this sort of question.

查看更多
登录 后发表回答