Click to See Complete Forum and Search --> : Is it possible to fire events from a second thread?


Alexander Serov
April 20th, 1999, 12:32 PM
Hi!
Is it possible to fire events from
a second thread?
When my event handler in Excel includes the string like " Cells(2,2).Value = MyObj.MyProp"
it becomes suspended! MyObj is my full control which fires an event from a second thread.
But the same component works fine in VB 6.0 !
Thanks in Advance!

April 29th, 1999, 11:37 PM
You need to marshal the IDispatch pointers (that you fire events back on) with CoMarshalInterThreadInterfaceInStream in the main thread and then unmarshal with
CoGetInterfaceAndReleaseStream in the second thread.