ctypes, python 2.5, WinFunctionType and _as_parameter_

Thomas Heller theller at ctypes.org
Tue Nov 7 21:39:02 CET 2006

gerard5609 at yahoo.fr schrieb:
> Hello,
> how to get at the function address of a WinFunctionType ctypes object ?
> With ctypes 1.0, I used just myfunc._as_parameter_ and all was well.
> With ctypes 1.0.1, that ships with python 2.5, WinFunctionType has no
> longer an _as_parameter_ attribute

I think the easiest way is to cast to function to a void pointer and
get the value of that.  Something like:

cast(function, c_void_p).value

> Where in the ChangeLog and the documentation is explained how to deal
> with this change ?

Hm, I considered _as_parameter_ an implementation detail ;-)

> Thanks in advance,
> Gerard

More information about the Python-list mailing list