win32com and DispatchWithEvents

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RyanN

    win32com and DispatchWithEvents

    Greetings,

    I'm trying to get DispatchWithEve nts() to work with HyperAccess
    (terminal program) without much success. I've done a bunch of
    searching and found some examples using IE:

    This works but doesn't handle the "Event Driven Functions":
    haObj = win32com.client .Dispatch(r"HAW in32")

    And so does this Internet Explorer Example:
    ieObj = win32com.client .DispatchWithEv ents
    ("InternetExplo rer.Application ", ExplorerEvents)

    But this does not:
    haObj = win32com.client .DispatchWithEv ents("HAWin32", HAEvents)
    It fails with the error message:
    "TypeError: This COM object can not automate the makepy process -
    please run makepy manually for this object"

    After some searching I tried:
    mod = win32com.client .gencache.Ensur eModule('{5178C CE1-AAEF-11CE-
    AE75-00AA0030EBC8}', 0, 1, 0)
    haObj = win32com.client .DispatchWithEv ents(mod, HAEvents)
    Which fails with the error message:
    ttributeError: 'module' object has no attribute 'GetTypeInfo'

    So I tried this approach with IE:
    mod = win32com.client .gencache.Ensur eModule('{EAB22 AC0-30C1-11CF-
    A7EB-0000C05BAE0B8}' , 0, 1, 0)
    ieObj = win32com.client .DispatchWithEv ents(mod, ExplorerEvents)
    But this too breaks with the same GetTypeInfo error.


    Any ideas or resources? I can provide the genpy output if that helps.
  • Mike Driscoll

    #2
    Re: win32com and DispatchWithEve nts

    On Nov 13, 10:27 am, RyanN <Ryan.N...@gmai l.comwrote:
    Greetings,
    >
    I'm trying to get DispatchWithEve nts() to work with HyperAccess
    (terminal program) without much success. I've done a bunch of
    searching and found some examples using IE:
    >
    This works but doesn't handle the "Event Driven Functions":
    haObj = win32com.client .Dispatch(r"HAW in32")
    >
    And so does this Internet Explorer Example:
    ieObj = win32com.client .DispatchWithEv ents
    ("InternetExplo rer.Application ", ExplorerEvents)
    >
    But this does not:
    haObj = win32com.client .DispatchWithEv ents("HAWin32", HAEvents)
    It fails with the error message:
    "TypeError: This COM object can not automate the makepy process -
    please run makepy manually for this object"

    Did you try the makepy process? I haven't used it lately, but I seem
    to recall it was easy to use...

    >
    After some searching I tried:
    mod = win32com.client .gencache.Ensur eModule('{5178C CE1-AAEF-11CE-
    AE75-00AA0030EBC8}', 0, 1, 0)
    haObj = win32com.client .DispatchWithEv ents(mod, HAEvents)
    Which fails with the error message:
    ttributeError: 'module' object has no attribute 'GetTypeInfo'
    >
    So I tried this approach with IE:
    mod = win32com.client .gencache.Ensur eModule('{EAB22 AC0-30C1-11CF-
    A7EB-0000C05BAE0B8}' , 0, 1, 0)
    ieObj = win32com.client .DispatchWithEv ents(mod, ExplorerEvents)
    But this too breaks with the same GetTypeInfo error.
    >
    Any ideas or resources? I can provide the genpy output if that helps.
    There's the PyWin32 user's group, where the maintainers of PyWin32
    hang out and answer questions:



    Mike

    Comment

    • RyanN

      #3
      Re: win32com and DispatchWithEve nts

      On Nov 13, 2:16 pm, Mike Driscoll <kyoso...@gmail .comwrote:
      On Nov 13, 10:27 am, RyanN <Ryan.N...@gmai l.comwrote:
      >
      >
      >
      Greetings,
      >
      I'm trying to get DispatchWithEve nts() to work with HyperAccess
      (terminal program) without much success. I've done a bunch of
      searching and found some examples using IE:
      >
      This works but doesn't handle the "Event Driven Functions":
      haObj = win32com.client .Dispatch(r"HAW in32")
      >
      And so does this Internet Explorer Example:
      ieObj = win32com.client .DispatchWithEv ents
      ("InternetExplo rer.Application ", ExplorerEvents)
      >
      But this does not:
      haObj = win32com.client .DispatchWithEv ents("HAWin32", HAEvents)
      It fails with the error message:
      "TypeError: This COM object can not automate the makepy process -
      please run makepy manually for this object"
      >
      Did you try the makepy process? I haven't used it lately, but I seem
      to recall it was easy to use...
      >
      >
      >
      After some searching I tried:
      mod = win32com.client .gencache.Ensur eModule('{5178C CE1-AAEF-11CE-
      AE75-00AA0030EBC8}', 0, 1, 0)
      haObj = win32com.client .DispatchWithEv ents(mod, HAEvents)
      Which fails with the error message:
      ttributeError: 'module' object has no attribute 'GetTypeInfo'
      >
      So I tried this approach with IE:
      mod = win32com.client .gencache.Ensur eModule('{EAB22 AC0-30C1-11CF-
      A7EB-0000C05BAE0B8}' , 0, 1, 0)
      ieObj = win32com.client .DispatchWithEv ents(mod, ExplorerEvents)
      But this too breaks with the same GetTypeInfo error.
      >
      Any ideas or resources? I can provide the genpy output if that helps.
      >
      There's the PyWin32 user's group, where the maintainers of PyWin32
      hang out and answer questions:
      >

      >
      Mike
      Thanks. I had used makepy to get the class ID and yes it was easy to
      use. I have asked on the python-win32 group as you suggested.

      -Ryan

      Comment

      Working...