?
MuehBln schrieb:
Beim Beenden des Hauptprogramms, beende ich die while-Schleife. Dann möchte ich aber noch auf das Ende des Threads warten, bevor ich die Applikation schließe. Wie mache ich das am besten?
Das hier habe ich mal irgendwo gefunden
// Now that all three threads are created and running, we need to stop the primary thread
// (which is this program itself - Remember that once "main" returns, our program exits)
// So that our threads have time to finish. To do this, we do what is called "Blocking".
// We're going to make main just stop and wait until all three threads are done.
// This is done easily with the next line of code. Please read the help file about
// the specific API call "WaitForMultipleObjects".
waiter = WaitForMultipleObjects(MAX_THREADS,hThreads,TRUE,INFINITE);