1
Answer

MessageQueue receiving

onez

onez

20y
1.7k
1
I have a background thread that checks for messages every 5 seconds. If I run the program, then close, then rebuild, VS gives an error that the program is still running. The only way to fix the error is restart the computer or always run in debug mode. Any idea what causes this problem or a better way to receive messages?
Answers (1)
0
shimtanny

shimtanny

NA 440 0 20y
Hi Is the IsBackground property true on the background thread. (-> MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemthreadingthreadclassisbackgroundtopic.asp ) This tells the thread, that if the main thread end, the background thread should also be terminated. In Taskmanager (or VS) you can check which or how many threads are still alive. Simon