<?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[Threads]]></title><description><![CDATA[<p>Hallo, mal wieder ein paar Frage zu Threads...</p>
<p>Ich habe einen WorkThread erstellt - eine Funktion mit einer while Schleife, die durch setzen eines Parameters beendet werden kann. Wird die Schleife beendet, endet auch die ThreadFunktion mit return 0.</p>
<ol>
<li></li>
</ol>
<p>ist damit auch der Thread beendet oder muss ich ihn anschließend noch manuell beenden?</p>
<ol start="2">
<li></li>
</ol>
<p>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?</p>
<ol start="3">
<li></li>
</ol>
<p>Wenn ich aus meinem Thread heraus<br />
((CMainFrame*) AfxGetMainWnd())-&gt;UpdateStatus(1)<br />
aufrufe, welche das TrayIcon aktualisiert, steht plötzlich beim Text des Tooltipps Blödsinn drin. Außerhalb des Threads klappt der Aufruf aber ganz normal.</p>
<p>Danke und Gruß<br />
Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/49441/threads</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 13:54:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/49441.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Sep 2003 09:51:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Threads on Fri, 19 Sep 2003 09:51:04 GMT]]></title><description><![CDATA[<p>Hallo, mal wieder ein paar Frage zu Threads...</p>
<p>Ich habe einen WorkThread erstellt - eine Funktion mit einer while Schleife, die durch setzen eines Parameters beendet werden kann. Wird die Schleife beendet, endet auch die ThreadFunktion mit return 0.</p>
<ol>
<li></li>
</ol>
<p>ist damit auch der Thread beendet oder muss ich ihn anschließend noch manuell beenden?</p>
<ol start="2">
<li></li>
</ol>
<p>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?</p>
<ol start="3">
<li></li>
</ol>
<p>Wenn ich aus meinem Thread heraus<br />
((CMainFrame*) AfxGetMainWnd())-&gt;UpdateStatus(1)<br />
aufrufe, welche das TrayIcon aktualisiert, steht plötzlich beim Text des Tooltipps Blödsinn drin. Außerhalb des Threads klappt der Aufruf aber ganz normal.</p>
<p>Danke und Gruß<br />
Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/356621</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/356621</guid><dc:creator><![CDATA[MuehBln]]></dc:creator><pubDate>Fri, 19 Sep 2003 09:51:04 GMT</pubDate></item><item><title><![CDATA[Reply to Threads on Fri, 19 Sep 2003 09:54:20 GMT]]></title><description><![CDATA[<p>Hi,<br />
der Thread ist dann beendet.</p>
<p>Das kannst Du überprüfen mit dem TaskManager -&gt; Reiter &quot;Prozesse&quot;, in der Spalte &quot;Threads&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/356623</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/356623</guid><dc:creator><![CDATA[Cosmixx]]></dc:creator><pubDate>Fri, 19 Sep 2003 09:54:20 GMT</pubDate></item><item><title><![CDATA[Reply to Threads on Fri, 19 Sep 2003 09:58:56 GMT]]></title><description><![CDATA[<p>Danke erstmal!<br />
Und kann mir noch jemand bei 2. und 3. helfen?</p>
<p>Gruß...Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/356627</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/356627</guid><dc:creator><![CDATA[MuehBln]]></dc:creator><pubDate>Fri, 19 Sep 2003 09:58:56 GMT</pubDate></item><item><title><![CDATA[Reply to Threads on Fri, 19 Sep 2003 10:09:31 GMT]]></title><description><![CDATA[<p>MuehBln schrieb:</p>
<blockquote>
<ol start="2">
<li></li>
</ol>
<p>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?</p>
</blockquote>
<p>Das hier habe ich mal irgendwo gefunden</p>
<pre><code class="language-cpp">// Now that all three threads are created and running, we need to stop the primary thread
 // (which is this program itself - Remember that once &quot;main&quot; returns, our program exits)
 // So that our threads have time to finish.  To do this, we do what is called &quot;Blocking&quot;.
 // 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 &quot;WaitForMultipleObjects&quot;.

	 waiter = WaitForMultipleObjects(MAX_THREADS,hThreads,TRUE,INFINITE);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/356636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/356636</guid><dc:creator><![CDATA[de_Bert[logout]]]></dc:creator><pubDate>Fri, 19 Sep 2003 10:09:31 GMT</pubDate></item></channel></rss>