ctypes, error when calling function

Richie Hindle richie at entrian.com
Thu Oct 7 10:07:50 EDT 2004


[Max]
> caps = MIDIOUTCAPS()
> [...]
> print winmm.midiOutGetDevCapsA(deviceID, caps, sizeof(caps))
> [...]
> ValueError: Procedure probably called with too many arguments (60 bytes 
> in excess)

You need to pass byref(caps) rather than caps.  The API expects a
pointer to the structure, not the structure itself.

-- 
Richie Hindle
richie at entrian.com




More information about the Python-list mailing list