python ctype question about "access violation reading location0x5a5a5a5a"

Y

Yanping Zhang

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"
2.
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
http://mail.yahoo.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top