Am 17.05.2014 21:20, schrieb Will Dormann:
> Hi folks,
>
> I'm interested in using comtypes to get the actual addresses of
> method/property names in a COM object.
>
> In typeinfo.py, I've commented out the following line:
> #raise "Check Me"
>
> Using test_typeinfo.py as a starting point, I've got a script that
> attempts to use AddressOfMember in the following way:
> address = ti.AddressOfMember(fd.memid, fd.invkind)
>
> This results in the following error:
> Traceback (most recent call last):
>    File "C:\ax.py", line 31, in <module>
>      address = ti.AddressOfMember(fd.memid, fd.invkind)
>    File
> "C:\Python27\lib\site-packages\comtypes-1.0.0-py2.7.egg\comtypes\typeinfo.py",
> line 316, in AddressOfMember
>      self.__com_AddressOfMember(memid, invkind, byref(p))
> _ctypes.COMError: (-2147317571, 'Wrong module kind for the operation.',
> (None, None, None, 0, None))
>
> The best info I could find online is this:
> <http://forums.codeguru.com/showthread.php?497293-Why-Exception-occured-getting-address-of-COM-function>
> but there's no answer.

MSDN says in 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms221544%28v=vs.85%29.aspx:

     Retrieves the addresses of static functions or variables, such as
     those defined in a DLL.

This seems to suggest that ITypeInfo::GetAddressOfMember works only for
static functions or static variables, but not for methods of COM object.

Thomas


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to