Set unhandled exception handler to write core dump file
move the cleanup code into __finally block
Use commandline instead of WM_COPYDATA in redirectTask
Disable warning 4996 in project properties