Subj : Re: Trying to set up a Response table for a dervied thread class but not working... To : borland.public.cpp.borlandcpp From : Bruce Salzman Date : Sun Jun 06 2004 07:54 pm "Antsy" wrote in message news:40c30b9d$1@newsgroups.borland.com... > > Hi again. I have done what you said and have had some success. I've dervied the class from both TWindow and Thread, and in turn the class is now picking up the events and processing the ones it needs to process...but there is one final hurdle (due to the fact that I am not too sure how to set up a message loop in the run method with out messing with the messaging processing of the entire application.) So what I did is below. I just have the run funtion looping indefinitely...whats not there is a mechnisim that i can call to exit the loop in the Run() method. Its there just not in the listing below. Now the problem is that when the Main application windows does a lenthy process, this thread below seems to stop processing messages until the lengthy process is completed in the Main application. But since this is a thread...I thought it would continue to do what it does while other things are happening. Maybe i should have a message loop in the Run() like you said. If so can you point me towards somewhere that does this in the context of threads. My thing is I can't visulize how it would be done, without someway affecting the message processing of the main window. Here is an example of a message loop: int TFoo::Run() { MSG Msg; while (!ShouldTerminate()){ if (GetMessage(&Msg, 0,0,0)){ TranslateMessage(&Msg); DispatchMessage(&Msg); } } } You can kill the thread by calling it's Terminate() method from your main application. Regards, Bruce .