ctypes - swig - pointer

gianluca geonomica at gmail.com
Mon Jun 30 12:13:42 EDT 2008


I've a problem with dll function colled with python/ctypes. My
functions (C) requred a typedef int  "value_type" in tree different
way:
same as value_type; - mydll.foo1(value_type)
same as *value_type; - mydll.foo2(*value_type)
same as **value_type; - mydll.foo3(**value_type)

How can pass it in python. If i do that:
rules=POINTER(value_type)
opr=rsl.StrengthOfRules(rules,10)
R=POINTER(rules)

I've this exception:
Traceback (most recent call last):
  File "C:\temp\cRSL.py", line 49, in <module>
    opr=rsl.StrengthOfRules(rules,10) #/* Creates a table of rules
strengths. */
ArgumentError: argument 1: <type 'exceptions.TypeError'>: Don't know
how to convert parameter 1

I've tried with swig (cpointer.i) olso  but the library don't work
correctly and rules look empty. I need help. Could anybody give mi it?

gima



More information about the Python-list mailing list