The exception points to the last line and shows me this:
Exception thrown at 0x00007FF9F23F5260 (user32.dll) in filetool.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
I know that there is a problem with pointer conversions. What I could observe is that when I comment the first line out there is no exception. So I guess there is a problem with this (FARPROC)obj->old_eventhandler();
old_eventhandler() has a void* as a return type. It is defined like this: