Mark,

MH> pB = mod.InterfaceB(pA.QueryInterface(IID_B, pythoncom.IID_IDispatch))

Thanks so much for the suggestion. I tried it, but it appears that pA does not provide a QueryInterface method.

    <output>
File "c:\Python25\lib\site-packages\win32com\client\__init__.py", line 454, in __getattr__ raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr) AttributeError: '<win32com.gen_py.TypelibA.InterfaceA instance at 0x13106712>' object has no attribute 'QueryInterface'
    </output>

Does this mean I'm out of luck?

MH> It might also be worth seeing if we can fix that somehow - eg, maybe an optional param allowing the interface and the object itself to be in those different typelibs.

I'm not sure what magic is involved behind the scenes, but this type of cast seems to be comparatively convenient and nearly transparent in VBA/VB (VB requires an explicit CType call), without the need to lookup CLSIDs/IIDs.
Thanks again,

   -Ben


_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to