宗文's profile方寸之间PhotosBlogLists Tools Help

Blog


    April 12

    如何从第二个线程触发COM事件

    有两篇文章说得比较透彻
    1)How to start a second thread in an MFC-based ActiveX control to fire events in Visual C++
    2)PRB: Firing Event in Second Thread Causes IPF or GPF
     
    主要的想法就是用窗口消息将第二个线程想要触发的事件传递到组件的套间线程内部,这样才能满足COM的套间线程模型的假定。