[python-win32] Problems with Implementing Callback Python/C++-DLL

Mark Hammond mhammond at skippinet.com.au
Sat Jul 30 07:28:46 CEST 2005


> So I’m not sure how can I “register” my_set_callback function in the
already
> started Python-Interpreter and to “explain” my DLL which Python-Function
is
> to call when the new values in my DLL were calculated.

I'm not sure I understand your problem.  The tail of the code you posted
looks like a standard Python module - although you did not show the "module
init" code.  Assuming this was a normal module, Python code would be able to
say:

import foo
foo.callback(some_func)

Which is how my_set_callback will be called.  However, if you have no module
init code, there will be no entry point to the function.  How is your DLL
loaded by Python (or is it your DLL that loads Python?).

Mark



More information about the Python-win32 mailing list