ctypes in python

Hi ALL,
I am using C language DLL in pyton.
for that i am using ctypes.
but my problem is when i tried to call an API in that dll , i am not
able to pass correct values.

basic function args are like this

int i=0;

sample(0, NULL, NULL, &i, NULL)

···

--------------------------------------------------------------------------------------------
i wrote code like this
from ctypes import *
mydll = cdll.LoadLibrary('simple.dll')

with this i am able to call rest of API's in that dll

how can i call aboue function in python.
how can i pass address of i?
can any body help me?
Thanks

I think you're looking for the ctypes mailing list:

···

On Jul 6, 7:18 am, steave waugh <waug...@gmail.com> wrote:

Hi ALL,
I am using C language DLL in pyton.
for that i am using ctypes.
but my problem is when i tried to call an API in that dll , i am not
able to pass correct values.

basic function args are like this

int i=0;

sample(0, NULL, NULL, &i, NULL)
--------------------------------------------------------------------------------------------
i wrote code like this
from ctypes import *
mydll = cdll.LoadLibrary('simple.dll')

with this i am able to call rest of API's in that dll

how can i call aboue function in python.
how can i pass address of i?
can any body help me?
Thanks

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

I think it is something like creating i as a c_int type, passing it to the function with byref(i) and then accessing the value afterward with i.value. But as Mike suggested check with the ctypes group or docs to be sure.

···

On 7/6/10 5:18 AM, steave waugh wrote:

Hi ALL,
I am using C language DLL in pyton.
for that i am using ctypes.
but my problem is when i tried to call an API in that dll , i am not
able to pass correct values.

basic function args are like this

int i=0;

sample(0, NULL, NULL,&i, NULL)
--------------------------------------------------------------------------------------------
i wrote code like this
from ctypes import *
mydll = cdll.LoadLibrary('simple.dll')

with this i am able to call rest of API's in that dll

how can i call aboue function in python.
how can i pass address of i?
can any body help me?

--
Robin Dunn
Software Craftsman