How to manage event of COM objects...

Discussion in 'Python' started by Laurent, Dec 5, 2005.

  1. Laurent

    Laurent Guest

    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
     
    Laurent, Dec 5, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Scarborough

    Manage State of COM objects

    Robert Scarborough, Jul 17, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    320
    Robert Scarborough
    Jul 17, 2003
  2. Martin Maercker

    JNI - how to manage C++ objects from Java?

    Martin Maercker, Jan 16, 2005, in forum: Java
    Replies:
    2
    Views:
    3,593
    Chris Uppal
    Jan 18, 2005
  3. Kai Schlamp
    Replies:
    6
    Views:
    376
    Kai Schlamp
    Nov 19, 2007
  4. Ian Collins
    Replies:
    1
    Views:
    325
    Ian Collins
    Aug 28, 2011
  5. HENRY Eshbaugh

    Re: Manage an unknown number of objects without malloc

    HENRY Eshbaugh, Aug 30, 2011, in forum: C Programming
    Replies:
    8
    Views:
    330
    Malcolm McLean
    Sep 27, 2011
Loading...

Share This Page