Markus Hubig wrote, On 4/10/2010 8:31 AM:
On Fri, Apr 9, 2010 at 11:05 PM, Greg Antal <greg.an...@ata-e.com> wrote:Actually, the way your PyMemtool.py file is defined, I think the original "fs" will be a generic COM object. The next-to-last line of the GetFlashModByName method definition is ret = Dispatch(ret, u'GetFlashModByName', None) That method is supposed to return a FlashMod object, so I think it should look like this: ret = Dispatch(ret, u'GetFlashModByName', '{661A8843-7984-11D2-9C7F-006097804445}') If you edit the PyMemtool.py file to look like that, the object returned should actually be of type DISMTFlashMod. And of course, if you do the typecast, it will certainly have that type. This may not actually be a problem. The way COM works, if you try to invoke FlashMod methods on the generic COM object, COM will try to find an object that can do what you're asking. As long as the FlashMod methods don't try anything fancy like using output ("ByRef") parameters, it will work. But this is just like not doing early binding for the FlashMod object. The entire chapter 12 of the book you mentioned is available at http://oreilly.com/catalog/pythonwin32/chapter/ch12.html I found this indispensable. I tried to find the book at several local book stores (I like going to physical book stores more than on-line stores; I'm old-fashioned that way), but none of them had it. One of the people monitors this mailing list, Tim Golden, has a really useful "how-to" page at http://timgolden.me.uk/python/win32_how_do_i/ Other than that, I just check with this mailing list and its archives. - Greg Antal
|
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32