About AfxEndThread:
"Call this function to terminate the currently executing thread."