如果我在对象创建线程中使用编组的 COM 接口指针,会发生什么情况?
我正在研究全局接口表的用法。 据我所知,当您从另一个 STA 线程调用 GetInterfaceFromGlobal() 时,您将获得原始接口指针的代理。代理负责将控制权传递给对象创建线程。
如果我只有一个线程并在这唯一的线程(即对象创建线程)中调用 GetInterfaceFromGlobal(),然后像使用原始接口指针一样使用返回的接口指针(实际上是一个代理)怎么办?换句话说,代理(应该由另一个线程使用)是否可用于主线程?
如果我在 MTA 线程中使用 MTA 对象的全局接口表会怎样?它会起作用还是会腐败?
提前致谢。
I am looking into the usage of Global Interface Table.
I understand that when you call GetInterfaceFromGlobal() from another STA thread you get a proxy to the original interface pointer. The proxy is responsible for passing control to the object creating thread.
What if I have only one thread and call GetInterfaceFromGlobal() in this only thread, i.e. the object creating thread, and then use the returned interface pointer (actually a proxy) just like using the original interface pointer? In other words, is the proxy (which is supposed to be used by another thread) usable to the main thread?
And what if I use the Global Interface Table in MTA threads for MTA object? Will it work or corrupt?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于不需要代理,您将获得自己的指针。
You will get your own pointer back since no proxy is necessary.