COM Events in multithreaded app trouble.

rcspython at yahoo.com rcspython at yahoo.com
Tue Aug 7 22:17:26 CEST 2001


Briefly,
I have a working demo using an ActiveX control including events.
Problem comes in when I try to make this demo multithreaded.
I essentially need 10 COM object instances (each passed to a 
different thread) to operate independently. They all need to receive 
COM events too. Can they all share one Event handler (as in the main 
thread?) or must I create a unique one for each COM object (messy).

Incidently, when the COM Events are returned to the handler they 
include the reference number (1-10) for each object. I was planning 
on setting events to indicate message arrival in the other threads. 
You can see I should only need one handler.

I have only 2 threads running in this test (the main and one COM 
object wrapper) and I am not seeing and Events! The object thread is 
there and logging and the main thread with 
pythoncom.PumpWaitingMessages()is running along.

Am I suffering from a GCE (Gross conceptual error) or making a simple 
mistake?

Any help would be welcome as I am quite stuck at the moment.

Best regards,
Ron





More information about the Python-list mailing list