<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Code nach exit()]]></title><description><![CDATA[<p>Hi, ich habe einen Thread, der exit(0) ausführt und dazu ein Window<br />
Code:</p>
<pre><code class="language-cpp">hThread = CreateThread(NULL, 0, ThreadProc, NULL, 0, &amp;dwThreadId);
	while(GetMessage(&amp;msg, NULL, 0, 0)) {
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	CloseHandle(hThread);
	FreeLibrary(dll);
	WSACleanup();
return 0;
</code></pre>
<p>Also der Thread hThread führt direkt exit(0) aus und damit schließt sich das Programm.<br />
Und jetzt frage mich, ob der Code weiter unten noch ausgeführt wird.<br />
Also das</p>
<pre><code class="language-cpp">CloseHandle(hThread);
	FreeLibrary(dll);
	WSACleanup();
</code></pre>
<p>Das ist ja zum &quot;Aufräumen&quot;.<br />
Wird das noch ausgeführt? Ist das überhaupt notwendig, oder wird sowieso aufgeräumt, wenn sich das Programm schließt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/187182/code-nach-exit</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 00:21:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187182.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Jul 2007 17:49:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Code nach exit() on Mon, 16 Jul 2007 17:49:55 GMT]]></title><description><![CDATA[<p>Hi, ich habe einen Thread, der exit(0) ausführt und dazu ein Window<br />
Code:</p>
<pre><code class="language-cpp">hThread = CreateThread(NULL, 0, ThreadProc, NULL, 0, &amp;dwThreadId);
	while(GetMessage(&amp;msg, NULL, 0, 0)) {
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	CloseHandle(hThread);
	FreeLibrary(dll);
	WSACleanup();
return 0;
</code></pre>
<p>Also der Thread hThread führt direkt exit(0) aus und damit schließt sich das Programm.<br />
Und jetzt frage mich, ob der Code weiter unten noch ausgeführt wird.<br />
Also das</p>
<pre><code class="language-cpp">CloseHandle(hThread);
	FreeLibrary(dll);
	WSACleanup();
</code></pre>
<p>Das ist ja zum &quot;Aufräumen&quot;.<br />
Wird das noch ausgeführt? Ist das überhaupt notwendig, oder wird sowieso aufgeräumt, wenn sich das Programm schließt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1326760</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326760</guid><dc:creator><![CDATA[peter pano]]></dc:creator><pubDate>Mon, 16 Jul 2007 17:49:55 GMT</pubDate></item><item><title><![CDATA[Reply to Code nach exit() on Mon, 16 Jul 2007 18:36:38 GMT]]></title><description><![CDATA[<p>Aus reiner (ANSI)-C-Sicht wird mit dem Aufruf von exit() die Liste der via atexit() registrierten Funktionen abgearbeitet. Inwiefern durch Multithreading/processing da evtl. Seiteneffekte auftreten, klären wir besser im WinAPI-Forum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1326785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326785</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 16 Jul 2007 18:36:38 GMT</pubDate></item><item><title><![CDATA[Reply to Code nach exit() on Mon, 16 Jul 2007 18:36:53 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-14811.html" rel="nofollow">Tim</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-10.html" rel="nofollow">ANSI C</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1326786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326786</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 16 Jul 2007 18:36:53 GMT</pubDate></item><item><title><![CDATA[Reply to Code nach exit() on Mon, 16 Jul 2007 18:48:00 GMT]]></title><description><![CDATA[<p>Mach doch mal direkt hinter CreateThread() nen Sleep(5000) oder so und lass dann hinter WSACleanup() noch ne MessageBox() aufpoppen oder so.<br />
Kommt keine MessageBox() wird das Programm wohl abgewürgt.</p>
<p>Rein-theoretisch wird sowieso aufgeräumt, aber sauber wäre das nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";D"
      alt="😉"
    /><br />
Besser wäre z.B. wenn der Thread statt exit() an dein Fenster z.B. nen WM_CLOSE sendet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1326792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1326792</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Mon, 16 Jul 2007 18:48:00 GMT</pubDate></item></channel></rss>