<div style="font-family: tahoma,sans-serif;" class="lf secttl">
  <span id="thread_subject_site">I posted this on comp.lang.python. but it has been pointed out to me that this is a better place to ask.<br></span><p><font class="fixed_width">I&#39;m trying to get <span style="font-family: courier new,monospace;">DispatchWithEvents()</span> to work with HyperAccess (terminal program) without much success.</font></p>
<p><font class="fixed_width">This works but doesn&#39;t handle the &quot;Event Driven Functions&quot;: <br> <span style="font-family: courier new,monospace;">haObj = win32com.client.Dispatch(r&quot;HAWin32&quot;) </span></font></p>
<p><font class="fixed_width"> I&#39;m certainly new to all this but I&#39;ve done a bunch of searching on google and found some examples using IE. This is derived from eventsFreeThreaded.py and eventsApartmentThreaded.py included as demos with win32com. I have to admit I don&#39;t really get the difference between Free Threaded and Apartment threaded or which I should be using. I feel like I&#39;m in over my ability level, but that&#39;s usually how you learn.<br>
 </font></p><p>T<font class="fixed_width">his Internet Explorer Example works: <br> <span style="font-family: courier new,monospace;">ieObj = win32com.client.DispatchWithEvents(&quot;InternetExplorer.Application&quot;, ExplorerEvents) </span><br>
 </font></p><p><font class="fixed_width">But this does not: <br> <span style="font-family: courier new,monospace;">haObj = win32com.client.DispatchWithEvents(&quot;HAWin32&quot;, HAEvents) </span><br> It fails with the error message: <br>
 <span style="font-family: courier new,monospace;">&quot;TypeError: This COM object can not automate the makepy process - please run makepy manually for this object&quot; </span><br></font></p><p><font class="fixed_width">I looked in the files generated by makepy (I used the COM Makepy utility in PythonWin) and after some searching I tried: <br>
 <span style="font-family: courier new,monospace;">mod = win32com.client.gencache.EnsureModule(&#39;{5178CCE1-AAEF-11CE-AE75-00AA0030EBC8}&#39;, 0, 1, 0) </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> haObj = win32com.client.DispatchWithEvents(mod, HAEvents) </span><br>
 Which fails with the error message: <br> <span style="font-family: courier new,monospace;">ttributeError: &#39;module&#39; object has no attribute &#39;GetTypeInfo&#39; </span><br> </font></p><p><font class="fixed_width">So I tried this approach with IE: <br>
 <span style="font-family: courier new,monospace;">mod = win32com.client.gencache.EnsureModule(&#39;{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B8}&#39;, 0, 1, 0) </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ieObj = win32com.client.DispatchWithEvents(mod, ExplorerEvents) </span><br>
 But this too breaks with the same GetTypeInfo error. <br> </font></p><font class="fixed_width">Any ideas or resources? I can provide the makepy output if that helps. </font><br>Here&#39;s a thread that almost mirrors my experience but never seems to come to a conclusion:<br>
<a href="http://mail.python.org/pipermail/python-win32/2006-August/004888.html">http://mail.python.org/pipermail/python-win32/2006-August/004888.html</a><br><br>Regards,<br><br>-Ryan Neve<br>UNC CH Inst. of Marine
Sciences<br></div>