[python-win32] Python and LabView over COM? (again)

Mark Hammond mhammond at skippinet.com.au
Thu Apr 21 13:36:51 CEST 2005

> I found an old thread in a python-list that discusses the
> same problem.
> http://mail.python.org/pipermail/python-list/2003-February/150857.html
> If I try the advice to use EnsureDispatch  I get following error:
>   File "ExportVIStrings.py", line 19, in ?
> app=win32com.client.gencache.EnsureDispatch("LabVIEW.Application.7")
>   File
> "C:\Python22\Core\lib\site-packages\win32com\client\gencache.py",
> line 434, in EnsureDispatch
>     disp_class = CLSIDToClass.GetClass(str(disp_clsid))
>   File
> "C:\Python22\Core\lib\site-packages\win32com\client\CLSIDToClass.py",
> line 50, in GetClass
>     return mapCLSIDToClass[clsid]
> KeyError: {9A872071-0A06-11D1-90B7-00A024CE2744}
> Are there some changes in win32com for Py23 or Py24 so that
> the problem
> could be fixed?
> How can I try to debug the dynamic.py to find the reason for
> the crashes
> and strange behavior?

Sorry to give such little info and send you fishing, but this sounds similar
to the problem we had with Lotus Notes in the early days  - adding "lotus
notes" to your search may dig up more than you want to know :)

Try something like:

  mod = gencache.EnsureModule(...)
  app = mod.Application()

For the exact spelling of the first line, run "makepy.py -i" and select the
LabView typelib.
For the second line, ".Application()" may not be correct, but given your
example (LabVIEW.Application.7), I suspect it is.  Examine the generated .py
file - 'mod' is that module.



More information about the Python-win32 mailing list