<?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[kein DC mehr Frei]]></title><description><![CDATA[<p>CRect CDetailWindow::SetWindowMappingRect(CRect rect)<br />
{<br />
CDC *pDC = GetWindowDC();<br />
SetScreenMapping(*pDC);<br />
pDC-&gt;LPtoDP(rect);<br />
pDC-&gt;ReleaseOutputDC();<br />
pDC-&gt;DeleteDC();<br />
delete *pDC;<br />
return rect;<br />
}</p>
<p>In folgender Funktion fordere ich eine DC an. Wenn das Programm länger läuft treten komische graphische - Effekte auf. Ich weiß, dass es nur eine begränzte Anzahl von DCs gibt - Gebe ich den DC eigentlich auch wieder richtig frei?</p>
<p>Folgende Fehlermeldung:<br />
The instruction at &quot;0x00439d8a&quot; referencd memory at &quot;0x00000000&quot;. The memory could not be &quot;read&quot;</p>
<p>Danke.</p>
<p>mfG<br />
Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/78927/kein-dc-mehr-frei</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 07:20:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/78927.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Jul 2004 13:04:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to kein DC mehr Frei on Tue, 06 Jul 2004 13:04:30 GMT]]></title><description><![CDATA[<p>CRect CDetailWindow::SetWindowMappingRect(CRect rect)<br />
{<br />
CDC *pDC = GetWindowDC();<br />
SetScreenMapping(*pDC);<br />
pDC-&gt;LPtoDP(rect);<br />
pDC-&gt;ReleaseOutputDC();<br />
pDC-&gt;DeleteDC();<br />
delete *pDC;<br />
return rect;<br />
}</p>
<p>In folgender Funktion fordere ich eine DC an. Wenn das Programm länger läuft treten komische graphische - Effekte auf. Ich weiß, dass es nur eine begränzte Anzahl von DCs gibt - Gebe ich den DC eigentlich auch wieder richtig frei?</p>
<p>Folgende Fehlermeldung:<br />
The instruction at &quot;0x00439d8a&quot; referencd memory at &quot;0x00000000&quot;. The memory could not be &quot;read&quot;</p>
<p>Danke.</p>
<p>mfG<br />
Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554454</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554454</guid><dc:creator><![CDATA[Martin3110]]></dc:creator><pubDate>Tue, 06 Jul 2004 13:04:30 GMT</pubDate></item><item><title><![CDATA[Reply to kein DC mehr Frei on Tue, 06 Jul 2004 13:48:57 GMT]]></title><description><![CDATA[<p>Servus,</p>
<p>ich habe DeleteDC und ReleaseDC getauscht, dann geht es. Aber leider kann ich dir das nicht erklären, warum das so ist <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<pre><code class="language-cpp">CRect CDetailWindow::SetWindowMappingRect(CRect rect) 
{ 
CDC *pDC = GetWindowDC(); 
SetScreenMapping(*pDC); 
pDC-&gt;LPtoDP(rect); 

pDC-&gt;DeleteDC(); // getauscht mit Release

pDC-&gt;ReleaseOutputDC(); 

delete *pDC; 
return rect; 
}
</code></pre>
<p>So geht es aber..... aber keine Erklärung -&gt; keine Ahnung davon <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=";)"
      alt="😉"
    /></p>
<p>*winke*<br />
Hellsgore</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554490</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Tue, 06 Jul 2004 13:48:57 GMT</pubDate></item><item><title><![CDATA[Reply to kein DC mehr Frei on Tue, 06 Jul 2004 15:01:47 GMT]]></title><description><![CDATA[<p>Seid ihr euch überhaupt sicher, dass man DELETEDC in diesem Fall nutzen darf/ kann/ sollte?</p>
<p>Denn meines Erachtens würdet ihr damit den Original-DC des &quot;angezapften&quot; Fensters löschen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554579</guid><dc:creator><![CDATA[a]]></dc:creator><pubDate>Tue, 06 Jul 2004 15:01:47 GMT</pubDate></item><item><title><![CDATA[Reply to kein DC mehr Frei on Tue, 06 Jul 2004 16:00:12 GMT]]></title><description><![CDATA[<p>a schrieb:</p>
<blockquote>
<p>Seid ihr euch überhaupt sicher, dass man DELETEDC in diesem Fall nutzen darf/ kann/ sollte?</p>
<p>Denn meines Erachtens würdet ihr damit den Original-DC des &quot;angezapften&quot; Fensters löschen...</p>
</blockquote>
<p>Aloha,</p>
<p>absolut korrekt.</p>
<p>Ums Delete kümmert sich das Fenster selbst, wenn Du es schließt.</p>
<pre><code class="language-cpp">CDC *pDC = GetWindowDC(); 
SetScreenMapping(*pDC); 
pDC-&gt;LPtoDP(rect); 
ReleaseDC(pDC);
return rect;
</code></pre>
<p>ist alles was Du brauchst...</p>
<p>Die Anzahl Deiner GDI-Objekte kannste übrigens sehr geil mit dem Task Manager betrachten.<br />
In Deinem Falle müßten die so sehr gewachsen sein, daß der Speicher Deiner Graka irgendwann &quot;Game over&quot; sagte...</p>
<p>Grüße</p>
<p>BOA</p>
]]></description><link>https://www.c-plusplus.net/forum/post/554648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/554648</guid><dc:creator><![CDATA[BOA]]></dc:creator><pubDate>Tue, 06 Jul 2004 16:00:12 GMT</pubDate></item><item><title><![CDATA[Reply to kein DC mehr Frei on Wed, 07 Jul 2004 09:56:48 GMT]]></title><description><![CDATA[<p>funktioniert.</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/555067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/555067</guid><dc:creator><![CDATA[Martin3110]]></dc:creator><pubDate>Wed, 07 Jul 2004 09:56:48 GMT</pubDate></item></channel></rss>