python ctype question about "access violation reading location0x5a5a5a5a"

Discussion in 'Python' started by Yanping Zhang, Mar 29, 2006.

  1. 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
    Yanping Zhang, Mar 29, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.