python ctype question about "access violation reading location 0x5a5a5a5a"

Yanping Zhang zhan0645 at
Wed Mar 29 02:38:36 CEST 2006

Hi All,

I need to use this C routine in python and there is a void pointer parameter in it: 
(this routine was written by someone else):

myfunc(int a, (void *)userdata, bool b)

I saw someone in his C++ wrapper used this routine in this way:
myfunc(a, (void *)0x5a5a5a5a, b)

In my python wrapper, I tried  to call it as the following and both failed:
1. myfunc(c_int(a), 0x5a5a5a5a, c_int(b))
   got error "access voilation reading from 0x5a5a5a5a"
  data = 0x5a5a5a5a
  mydata = c_void_p(data)
  myfunc(c_int(a), mydata, c_int(b))
  same error as in 1

Can anyone know how to fix it? Thanks!


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Python-list mailing list