[Zope-dev] COM

Toby Dickenson tdickenson@geminidataloggers.com
Wed, 12 Apr 2000 07:38:44 +0100


On Tue, 11 Apr 2000 18:02:03 -0500, "Jim Sanford"
<jsanford@atinucleus.com> wrote:

>Have managed to get by the CoInitialize problem using COM with Zope
>in an external method.

OK. Are you calling CoInitializeEx(COINIT_MULTITHREADED)? If not you
may be in for some subtle bugs.

However, I don't think thats the cause of this.

> Error type:  AttributeError
> Error value: GetModuleForCLSID
.....snip the boring bit of the traceback
>  File C:\Program Files\AtiAnywhere\Extensions\WordR.py, line 23, in formletter
>  File C:\Program Files\AtiAnywhere\Extensions\WordR.py, line 9, in __init__
>  File C:\Program Files\Python\win32com\client\__init__.py, line 28, in Dispatch
>AttributeError: (see above)

Thats very strange. Lines around 28 of __init__ are...

      try:
        import gencache
        if gencache.GetModuleForCLSID(resultCLSID) is not None:


And the module gencache definitely includes GetModuleForCLSID, so that
doesn't explain the AttributeError.

Can I suggest you change this to....

      try:
        import gencache
	raise 'eh?', (gencache,dir(gencache))
        if gencache.GetModuleForCLSID(resultCLSID) is not None:

That should tell you exactly what gencache is, and what symbols it
contains. Hopefully that should be a hint to the real problem.

(ps. Then remove that line when you are done, or youll find all your
other pythoncom scripts are broken ;-)


Toby Dickenson
tdickenson@geminidataloggers.com