最佳答案
我认为this page很好地涵盖了它。 调用 RegisterInterfaceInGlobal 将您的 COM 接口(interface)放入 GIT,将其 cookie 传递给您的其他线程,然后其他线程可以使用该 cookie 调用 GetInterfaceFromGlobal 以获取原始接口(interface)。
请注意,每个线程都必须调用 CoCreateInstance(CLSID_StdGlobalInterfaceTable... 但别担心,它们都会获得一个指向相同 GIT 实例的接口(interface)指针。
关于c++ - 如何使用 IGlobalInterfaceTable 传递接口(interface)指针?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/581172/