On Thu, Aug 21, 2008 at 1:16 PM, Anthony Tuininga
<[EMAIL PROTECTED]> wrote:
> installation of AutoPLANT which sits on top of AutoCAD -- but pywin32
> seems to have no difficulty with it and I really need that for my work
> so I can't simply uninstall it. Why AutoPLANT would cause

I had a similar problem with MS Word. You can see the mail trail in
archives http://thread.gmane.org/gmane.comp.python.comtypes.user/153
Can you try using "Dynamic Dispatch" branch of comtypes?
I suspect that something is corrupting COM vtable of
"AutoCAD.Application" object. Thus, only IDispatch interface works
(making win32com work) and direct method invocation used by comtypes
fails.
I resolved my problem by completely removing MS Office & reinstalling it.

> As for debugging, what sort of debugger were you referring to? I'm not
> familiar with the comtypes architecture yet so some pointers as to
> where to look would be helpful. I already saw the "QueryInterface"

I think you need to build python from source with debugging enabled &
use either Visual Studio or WinDBG or GDB to check values being
returned by COM interface.

This is just an arrow in the dark to check validity of COM interface
table. You can print it using following code:

>>> doc = app.ActiveDocument
>>> import re
>>> get_addr = lambda func: int(re.search('0x(?P<addr>[a-f\d]+)', 
>>> repr(func.im_func), re.I).group('addr'), 16)
>>> from pprint import pprint as pp
>>> pp([(i, get_addr(getattr(doc, i))) for i in dir(doc) if '__com_' in i and i 
>>> != '__com_interface__'])

The offset between any two addresses within the same interface in the
printed table should be same even on different machines. Can you run
this code on the working & non-working machine and check if offsets
differ?

Regards,
Suraj

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to