From: px <px...@qu...> - 2009-06-15 15:09:36
|
Hi there, I'm relatively new to COM and have recently discovered comtypes (this lib is GREAT! Thanks!). I've got a lot of things working so far, but I'm stuck on trying to create an implementation of a COM interface object. I think my issue is basic and straight forward, but so far no luck with whatever examples I could find. Maybe because I'm still a COM newb :) Basically I have an interface "ISomeInterface" and I need to create an implementation of this interface to pass it as a parameter to another COM call. In the generated comtypes .py file, I see it actually creates a code stub for you that looks like this: class ISomeInterface_Impl(object): def blah(self): '-no docstring-' #return It sounds like this is exactly what I'd like to do. Define the _Impl, create it, override methods as needed, but some things don't make sense to me. 1) Why is it extending object? Shouldn't it extend ISomeInterface ? 2) I've seen in some posts that _com_interfaces_ needs to be defined 3) In other posts, I've also seen COMObject extended instead of object I've tried a lot of different permutations, but it seems I'm unable properly pass the object as a parameter to another COM call that expects ISomeInterface implementation as a parameter. Does anyone have examples of implementing a COM interface? Or know what I might be missing? Any help or suggestions would be greatly appreciated! I hope I've put enough detail into my question. Cheers! Eddie |