Quote Originally Posted by aragornx View Post
Code:
BOOL CReaderThread::InitInstance() {
	TRACE( _T("CReaderThread::InitInstance() START\r\n") );
	if ( reader != NULL ) {
		if ( start() == true ) {
			mainLoop();
		}
	}
	stop();
	TRACE( _T("CReaderThread::InitInstance() STOP\r\n") );
	AfxEndThread(0);
	return TRUE;
}
The code in bold text is wrong. It is always wrong to do something extensive in InitInstance(). The purpose of InitiInstance) is initialization only, after which you should simply return TRUE so as to allow the built-in message loop to commence. Your code, on the other hand, traps the InitiInstance() function, by calling your mainLoop() function forever, and never allows InitInstance() to return. Thus, you block the built-in message loop from ever even starting.