Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 6th, 2006, 10:55 PM
gerard5609@yahoo.fr
Guest
 
Posts: n/a
Default ctypes, python 2.5, WinFunctionType and _as_parameter_

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

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

Thanks in advance,

Gerard

  #2  
Old November 7th, 2006, 08:25 PM
Thomas Heller
Guest
 
Posts: n/a
Default Re: ctypes, python 2.5, WinFunctionType and _as_parameter_

gerard5609@yahoo.fr schrieb:
Quote:
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
Quote:
Where in the ChangeLog and the documentation is explained how to deal
with this change ?
Hm, I considered _as_parameter_ an implementation detail ;-)
Quote:
Thanks in advance,
>
Gerard
>
Thomas

  #3  
Old November 7th, 2006, 11:55 PM
gerard5609@yahoo.fr
Guest
 
Posts: n/a
Default Re: ctypes, python 2.5, WinFunctionType and _as_parameter_


Thomas Heller a écrit :
Quote:
cast(function, c_void_p).value
Yes, it works. Many thanks !

Gerard

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles