Richie Hindle | 1 Mar 2005 15:04
Favicon

Re: Datatypes and defining a struct


[Max]
> As far as I know, a Word is an unsigned 16 bit unsigned integer, so my 
> best match for it is:
> 
> MAXPNAMELEN = 32
> class MIDIOUTCAPS(Structure):
>      _fields_ = [
>          ("wMid", c_uint), # WORD
>          ...

You should use the ctypes.wintypes module:

>>> from ctypes.wintypes import *
>>> WORD
<class 'ctypes.c_ushort'>

--

-- 
Richie Hindle
richie <at> entrian.com

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

Gmane