The main form OnShow opened a TThread child thread, in the child thread
while (! StopRunning)
{
:: Sleep (50);
Application-> ProcessMessages ();
}
If you don't add Application-> ProcessMessages () ;, the program will die. Why?
I added a new form in front of while, but it didn't show. If the form is not new, then Application-> ProcessMessages (); will not be added.
What is the reason for the master's explanation, thank you
But the main thread should not die. I loop while in the child thread. I tried if the form is not created in that child thread, the main thread will not die without Application-> ProcessMessages ()
Application-> ProcessMessages () is to let the main process accept new messages, but multithreading is to allow each thread to work independently. I think there is a problem with the multithreading design of the year.