How to manage event of COM objects...

L

Laurent

Hello,

I'm currently trying to use event from a win32 application using it's
COM interface.

To connect to the application I use:

class MyApp_InterfaceManager (Thread):
...
def run (self):
# First we initialize the COM libraries for current thread
pythoncom.CoInitialize()
#Then we connect to the app with event handling...
self.app = DispatchWithEvents('MyApp',MyApp_AppEvents)

class MyApp_AppEvents:
OnHalt:
print "halt event..."

From here all is ok when the OnHalt event arrives the print is called.
The problem I have is that I need that MyApp_AppEvents class knows the
thread object to call a thread function when the event occurs(for
example I need to toggle a flag)

I've got no idea how to do that!
Anyone has encoutered the problem?
I've tryied to use getevents but with no result...
Help!

Best regards,

Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top