I integrate a dll to python by ctypes, the dll need set a callback function. But the dll callback function declare as below
void setCallBack(void(*)(Data &a))
Data is C struct, declare as below
typedef struct {
int index,
....
}Data
I do not clear how to set it by ctypes, I try it as below, but return "WindowsError: [Error -1073741795] Windows Error 0xC000001D" error, could you help to give a example how to set the callback.
mydll = cdll.LoadLibrary("XXX.dll")
callback_type = CFUNCTYPE(None, POINTER(Data))
callback = callback_type(Data)
mydll.setCallBack(callback)
def dataResponse(data):
print data.index
class Data(ctypes.Structure):
_fields_ = [("index", c_int)]