resurtm wrote:
> Can anybody explain my errors when trying to pass callback to DLL
> function?
> 
> Thanks for advices and solutions!

You have to keep a reference to the callback alive yourself. ctypes
doesn't increase the refernece counter of the function when you define a
callback. As soon as the ref counter reaches 0, the function object is
collected and the pointer to the callback is invalid.

You could assign it to a module global or instance variable.

Christian

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to