COM线程模型

来源:互联网 发布:mac装双系统内存不足 编辑:程序博客网 时间:2024/06/14 01:51

《COM线程模型》中已经说明,接口指针是线程相关,虽然逻辑上指向同一个对象,但不同的线程由于代理对象的原因而实际获得的接口指针也是不同的。但由于逻辑上是同一个对象,可以有一种接口的中立形式,与线程无关,唯一表示真正的接口指针。CoMarshalInterThreadInterfaceInStream和CoGetInterfaceAndReleaseStream可以实现跨线程接口共享。如果不对接口进行共享处理,你对接口的调用可能会出现“0x8001010e 应用程序调用一个已为另一线程整理的界面”。


2017-11-14 15:34:33 0195: <SOPCC_ConnectToServer> CoMarshalInterThreadInterfaceInStream, Ret:0x0-Address:0x106dcc
2017-11-14 15:34:33 0200: <SOPCC_ConnectToServer> 【Server5.OPC3.String】 call completed, Ret:0x0.
2017-11-14 15:34:33 0201: <SOPCC_ConnectToServer> CoGetInterfaceAndReleaseStream, Ret:0x0-Address:0x1030fc
2017-11-14 15:34:33 0201: <SOPCC_ConnectToServer::CoCreateInstanceEx IUnknown pointer address 0x1030fc




2017-11-14 15:34:43 0632: <SOPCC_ConnectToServer> CoMarshalInterThreadInterfaceInStream, Ret:0x0-Address:0x131d54
2017-11-14 15:34:43 0634: <SOPCC_ConnectToServer> 【Server3.OPC1.JNT3001_T3002】 call completed, Ret:0x0.
2017-11-14 15:34:43 0634: <SOPCC_ConnectToServer> CoGetInterfaceAndReleaseStream, Ret:0x0-Address:0x131c64
2017-11-14 15:34:43 0634: <SOPCC_ConnectToServer::CoCreateInstanceEx IUnknown pointer address 0x131c64


原创粉丝点击