pyhook_py3k
pyhook_py3k copied to clipboard
Access violation, try/catch?
Mouse hook (all) doesn't work on my end creating access violation and silently exit the program. It looks like that when I move the mouse quickly to the top edge it exits with access violation. I found the bug is on the line
win_name_decoded = PyUnicode_DecodeFSDefault(win_name);
and later on
Py_DECREF(win_name_decoded);
A temporary solution was to completely disable decode win_name_decoded = win_name; //PyUnicode_DecodeFSDefault(win_name);
and it works fine on python but when I create exe out of it
pyinstall.exe myfile.py
the bug is still there and access violation appears.
And my question is why there is no try/catch on the cpyHook.i ? Can anyone help me how to include the entire code in a try/catch so it will not silently exit the program upon error? I find very bad design from the original developer having an entire project without any try/catch.