Re: [python-win32] Casting to interface from different typelib?

2009-01-11 Thread Mark Hammond
On 11/01/2009 5:34 PM, Ben Gordon wrote: 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. oops - try pA._oleobj_.QueryInterface(...) I'm not sure

Re: [python-win32] Casting to interface from different typelib?

2009-01-11 Thread Ben Gordon
Mark, MH oops - try pA._oleobj_.QueryInterface(...) I just tried that too. Now, the cast succeeds as before (according to print pB), but the method call [Count()] still fails in the same way as before too. I appreciate the help, though! Even if we can't work out a fix, do you have any

[python-win32] Casting to interface from different typelib?

2009-01-09 Thread Ben Gordon
Any help here would be appreciated. But I hope I don't kill my odds by having redacting the names of all the (proprietary) libraries involved. (Or by the fact that I'm new to COM.) Anyhow, as part of a collaboration, I'm building a win32 application that uses COM to interact with several

Re: [python-win32] Casting to interface from different typelib?

2009-01-09 Thread Mark Hammond
On 10/01/2009 12:27 AM, Ben Gordon wrote: Try something like: #Now, the cast mod = gencache.GetModuleForTypelib(typelibB_CLSID,0x0,1,0) pB = mod.InterfaceB(pA) pB = mod.InterfaceB(pA.QueryInterface(IID_B, pythoncom.IID_IDispatch)) CastTo fails because The interface does not appear in the