<?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[CString im Thread problem]]></title><description><![CDATA[<p>Hallo</p>
<p>ich habe ein Problem mit meiner Strinverarbeitung im Thread. Und zwar stürtzt er immer ab, sobald ich einem String einen Wert zuweisen will.</p>
<p>Folgender Code:</p>
<pre><code class="language-cpp">AfxBeginThread(StarteXY,this,TRHEAD_PRIORITY_NORMAL);
this-&gt;g_eventSart.SetEvent(); //member von CEvent
</code></pre>
<pre><code class="language-cpp">//Thread
UINT StarteXY(LPVOID pParam)
{
    CTestDlg* pDlg = (CTest*) pParam;
    while ( ::WaitForSingleObject(pDlg-&gt;g_eventKill,0) != WAIT_OBJECT_0 )
    {    
        ....
        pDlg-&gt;SubMethode();
    }
    return 0;
}
</code></pre>
<pre><code class="language-cpp">void CTestDlg::SubMethode()
{
    CString str_Temp;
    str_Temp = &quot;1234&quot;; //und hier passiert es dann
}
</code></pre>
<p>das einzigste, was ich an Fehlerausgabe habe ist dieses hier:</p>
<pre><code>HEAP: Free Heap block 1274d90 modified at 1274db8 after it was freed
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/185512/cstring-im-thread-problem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 18:44:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185512.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Jun 2007 13:39:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CString im Thread problem on Tue, 26 Jun 2007 13:40:10 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ich habe ein Problem mit meiner Strinverarbeitung im Thread. Und zwar stürtzt er immer ab, sobald ich einem String einen Wert zuweisen will.</p>
<p>Folgender Code:</p>
<pre><code class="language-cpp">AfxBeginThread(StarteXY,this,TRHEAD_PRIORITY_NORMAL);
this-&gt;g_eventSart.SetEvent(); //member von CEvent
</code></pre>
<pre><code class="language-cpp">//Thread
UINT StarteXY(LPVOID pParam)
{
    CTestDlg* pDlg = (CTest*) pParam;
    while ( ::WaitForSingleObject(pDlg-&gt;g_eventKill,0) != WAIT_OBJECT_0 )
    {    
        ....
        pDlg-&gt;SubMethode();
    }
    return 0;
}
</code></pre>
<pre><code class="language-cpp">void CTestDlg::SubMethode()
{
    CString str_Temp;
    str_Temp = &quot;1234&quot;; //und hier passiert es dann
}
</code></pre>
<p>das einzigste, was ich an Fehlerausgabe habe ist dieses hier:</p>
<pre><code>HEAP: Free Heap block 1274d90 modified at 1274db8 after it was freed
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1314032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314032</guid><dc:creator><![CDATA[MSS-Software]]></dc:creator><pubDate>Tue, 26 Jun 2007 13:40:10 GMT</pubDate></item><item><title><![CDATA[Reply to CString im Thread problem on Tue, 26 Jun 2007 17:35:47 GMT]]></title><description><![CDATA[<p>Dein Problem entsteht woanders.</p>
<p>z.B. ... wenn du in dem Thread schon auf den Dialog zugreifst solltest du wohl auch sicherstellen dass der Dialog nicht zerstört wird bevor der Thread terminiert hat.<br />
D.h. du musst nach dem SetEvent() darauf warten dass der Thread terminiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1314208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314208</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 26 Jun 2007 17:35:47 GMT</pubDate></item></channel></rss>