<?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[GDI Leak?]]></title><description><![CDATA[<p>Hi, ich spiel grad einwenig mit Visual Styles rum, und im folgenden Code tritt bei mir ein GDI Resource Leak auf. Pro redraw steigt mein GDI Object Count um eins an. Ich hab das Problem auf diese Methode eingekreist kann es mir aber ehrlich gesagt nicht wirklich erklären.<br />
Kann mir jemand verraten ob er da etwas entdeckt was problematisch sein könnte? Irgendwie habe ich nämlich das gefühl das</p>
<p>DrawThemeBackground(theme,hdcmem,10,0,&amp;crc,0 ); daran Schuld ist.</p>
<pre><code class="language-cpp">void browser_modul::on_paint(HDC hdc ,PAINTSTRUCT&amp; ps){
        RECT client;
        GetClientRect(handle,&amp;client);
        HDC hdcmem = CreateCompatibleDC(hdc);
        HBITMAP hbm = CreateCompatibleBitmap(hdc,client.right,client.bottom);
        HGDIOBJ oldbm = SelectObject(hdcmem,hbm);

        if (theme)
        {
            RECT crc;
            GetClientRect(handle,&amp;crc);            
            DrawThemeBackground(theme,hdcmem,10,0,&amp;crc,0  );
        }

        BitBlt(hdc,0,0,client.right,client.bottom,hdcmem,0,0,SRCCOPY);

        SelectObject(hdcmem,oldbm);
        DeleteObject(hdcmem);
        DeleteObject(oldbm);
    }
</code></pre>
<p>BR<br />
evilissimo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/141426/gdi-leak</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 10:26:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/141426.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Mar 2006 21:00:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GDI Leak? on Tue, 21 Mar 2006 21:00:59 GMT]]></title><description><![CDATA[<p>Hi, ich spiel grad einwenig mit Visual Styles rum, und im folgenden Code tritt bei mir ein GDI Resource Leak auf. Pro redraw steigt mein GDI Object Count um eins an. Ich hab das Problem auf diese Methode eingekreist kann es mir aber ehrlich gesagt nicht wirklich erklären.<br />
Kann mir jemand verraten ob er da etwas entdeckt was problematisch sein könnte? Irgendwie habe ich nämlich das gefühl das</p>
<p>DrawThemeBackground(theme,hdcmem,10,0,&amp;crc,0 ); daran Schuld ist.</p>
<pre><code class="language-cpp">void browser_modul::on_paint(HDC hdc ,PAINTSTRUCT&amp; ps){
        RECT client;
        GetClientRect(handle,&amp;client);
        HDC hdcmem = CreateCompatibleDC(hdc);
        HBITMAP hbm = CreateCompatibleBitmap(hdc,client.right,client.bottom);
        HGDIOBJ oldbm = SelectObject(hdcmem,hbm);

        if (theme)
        {
            RECT crc;
            GetClientRect(handle,&amp;crc);            
            DrawThemeBackground(theme,hdcmem,10,0,&amp;crc,0  );
        }

        BitBlt(hdc,0,0,client.right,client.bottom,hdcmem,0,0,SRCCOPY);

        SelectObject(hdcmem,oldbm);
        DeleteObject(hdcmem);
        DeleteObject(oldbm);
    }
</code></pre>
<p>BR<br />
evilissimo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1021356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1021356</guid><dc:creator><![CDATA[evilissimo]]></dc:creator><pubDate>Tue, 21 Mar 2006 21:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to GDI Leak? on Tue, 21 Mar 2006 21:09:28 GMT]]></title><description><![CDATA[<p>man o man, hat sich schon erledigt. ich hab oldbm gelöscht muss aber hbm löschen -.- <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<pre><code class="language-cpp">DeleteObject(oldbm);
</code></pre>
<p>Thx anyway <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>BR</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1021364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1021364</guid><dc:creator><![CDATA[evilissimo]]></dc:creator><pubDate>Tue, 21 Mar 2006 21:09:28 GMT</pubDate></item></channel></rss>