【问题标题】:How to use IGlobalInterfaceTable to pass an interface pointer?如何使用 IGlobalInterfaceTable 传递接口指针?
【发布时间】:2010-10-09 12:46:25
【问题描述】:
  • 没有
    • MFC
    • ATL

问题:

【问题讨论】:

    标签: c++ visual-studio-2008 multithreading com


    【解决方案1】:

    我认为this page 很好地涵盖了它。 调用 RegisterInterfaceInGlobal 将您的 COM 接口放入 GIT,将其 cookie 传递给您的其他线程,然后可以使用该 cookie 调用 GetInterfaceFromGlobal 以获取原始接口。

    请注意,每个线程都必须调用 CoCreateInstance(CLSID_StdGlobalInterfaceTable... 但别担心,它们都会获得指向同一 GIT 实例的接口指针。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-03
      • 2018-09-07
      • 2020-02-07
      • 1970-01-01
      • 1970-01-01
      • 2019-01-08
      • 1970-01-01
      • 2017-06-21
      相关资源
      最近更新 更多