GLB_ON_QUIT does not seem to fire with a console program. How can I make something happen when the window is closed or ctrl+c is pressed?
Implement atexit:
http://www.cplusplus.com/reference/cstdlib/atexit/
Quote from: Kitty Hello on 2019-Dec-07
Implement atexit:
http://www.cplusplus.com/reference/cstdlib/atexit/
HelloKitty - I am not very good at INLINE and implementing C++ stuff. Could you or someone please show me how to make a SUB that is called when exiting?
Thank you so much <3
Here's a minimal example that works for me. It might NOT work for x64 builds, yet. The problem is the atexit(int) argument.
IMPORT "C" void atexit(int)
atexit(ADDRESSOF(OnConsoleExit))
FUNCTION OnConsoleExit%:
STDOUT "Wohoo\n"
KEYWAIT
ENDSUB