hi,
 
I need to use ctypes to call the API function like
 
fun1(&list, listLen)              //here  list is struct { long id; long type; long isOpen;}  ListItem;
 
so I define

class LIST_ITEM(Structure):
    _fields_ = [("Id", c_ulong),
                ("Type",c_ulong ),   
                ("isOpen", c_ulong),               
                ]
 
list=LIST_ITEM()
listLen=c_ulong(1)
thedriver.fun1(byref(list),listLen)
doesn't work, here the list is input param, not return info.
 
if use
list=c_char_p()
thedriver.fun1(byref(list),listLen)
 
how can I convert the list to LIST_ITEM?
 
another Q is :
how to use ctypes to implement this:
 
  struct1 mySettings;                              // here struct1 {long size; long params[32];}
   mySettings.size = sizeof(mySettings);
 
Where can get ctypes good samples? the samples with the package seems very simple. and the ctypes tutorial doesn't handle these cases either.
 
Thanks in advance
 
James
 
 
 
 
 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to