Re: ctypes and reading value under pointer passed as param of a callback

2008-07-25 Thread waldek
On Jul 24, 5:01 pm, Thomas Heller [EMAIL PROTECTED] wrote: waldekschrieb: Hi, I'm using C dll with py module and wanna read value (buffer of bytes) returned in py callback as parameter passed to dll function. The callback receives a pointer instance. You can dereference the pointer to

Re: ctypes and reading value under pointer passed as param of a callback

2008-07-25 Thread Mark Tolonen
waldek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Jul 24, 5:01 pm, Thomas Heller [EMAIL PROTECTED] wrote: waldekschrieb: Hi, I'm using C dll with py module and wanna read value (buffer of bytes) returned in py callback as parameter passed to dll function. The callback

ctypes and reading value under pointer passed as param of a callback

2008-07-24 Thread waldek
Hi, I'm using C dll with py module and wanna read value (buffer of bytes) returned in py callback as parameter passed to dll function. -- def mycallback(data, size): # how to read data buffer here ? return 0 cbfunc = CFUNCTYPE(c_int,

Re: ctypes and reading value under pointer passed as param of a callback

2008-07-24 Thread Thomas Heller
waldek schrieb: Hi, I'm using C dll with py module and wanna read value (buffer of bytes) returned in py callback as parameter passed to dll function. The callback receives a pointer instance. You can dereference the pointer to read individual bytes in this way: print data[0], data[5],