<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : BUG: Invalid assert in CXTPFontDC of v19.3</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : BUG: Invalid assert in CXTPFontDC of v19.3]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 07 Jun 2026 23:50:29 +0000</pubDate>
  <lastBuildDate>Tue, 15 Jun 2021 17:56:33 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=24170</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[BUG: Invalid assert in CXTPFontDC of v19.3 : Hi, that&amp;#039;s the leak in rich...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24170&amp;PID=78128&amp;title=bug-invalid-assert-in-cxtpfontdc-of-v19-3#78128</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8199">astoyan</a><br /><strong>Subject:</strong> 24170<br /><strong>Posted:</strong> 15 June 2021 at 5:56pm<br /><br />Hi, that's the leak in rich edit itself and we're aware of it. You don't need to remove anything, add font.DisableHandleLeakDetection() right after declaring the font variable, it should do the trick.]]>
   </description>
   <pubDate>Tue, 15 Jun 2021 17:56:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24170&amp;PID=78128&amp;title=bug-invalid-assert-in-cxtpfontdc-of-v19-3#78128</guid>
  </item> 
  <item>
   <title><![CDATA[BUG: Invalid assert in CXTPFontDC of v19.3 : Hi;I believe that the selected...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24170&amp;PID=78126&amp;title=bug-invalid-assert-in-cxtpfontdc-of-v19-3#78126</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 24170<br /><strong>Posted:</strong> 15 June 2021 at 7:50am<br /><br /><div>Hi;</div><div><br></div><div>I believe that the selected VERIFY() statement is wrong. I use the CXTPRichRender to render a RTF text with a preselected font and therefore the condition is NEVER met - it can't:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode">void CXTPFontDC::ReleaseFont()<br>{<br>&nbsp;&nbsp; &nbsp;if (NULL != m_pOldFont)<br>&nbsp;&nbsp; &nbsp;{<br>#ifdef _DEBUG<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; if (NULL != m_pCurrentFont)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; VERIFY((<font color="#990000"><b>m_pDC-&gt;SelectObject(m_pOldFont)-&gt;GetSafeHandle()<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; == m_pCurrentFont-&gt;GetSafeHandle()</b></font>)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &amp;&amp; "Potential GDI leak detected: Another font has been selected to the memory "<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; "DC and not released.");<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_pDC-&gt;SelectObject(m_pOldFont);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; }<br>#else<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; m_pDC-&gt;SelectObject(m_pOldFont);<br>#endif<br><br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; m_pOldFont&nbsp;&nbsp;&nbsp; &nbsp;= NULL;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; m_pCurrentFont = NULL;<br>&nbsp;&nbsp; &nbsp;}<br>}</pre></td></tr></table></div><div><br></div><div>I use this code (simplified) to render the text and as you see I never assign another font:</div><div><table width="99%"><tr><td><pre class="BBcode">CXTPClientRect rc(this);<br>CXTPBufferDC memDC(dc, rc);<br><br>DrawBackground(&amp;memDC, &amp;m_toolVisible, rc);<br><br>COLORREF clrTextColor = m_pContext-&gt;GetTipTextColor();<br>memDC.SetBkMode(TRANSPARENT);<br>memDC.SetTextColor(clrTextColor);<br>CXTPFontDC font(&amp;memDC, _pMyContext-&gt;GetFont());<br>&nbsp;&nbsp;&nbsp; <br></div><div>rc.DeflateRect(m_pContext-&gt;GetMargin());<br>rc.DeflateRect(3, 3, 3, 3);<br>m_render.DrawText(pDC, rc);<br>font.ReleaseFont();&nbsp; <font color="#990000"><b>&lt;-- Here above VERIFY fails</b></font><br><br>CWnd::DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);</pre></td></tr></table></div><div><br></div><div>Can I safely remove the VERIFY()?<br></div>]]>
   </description>
   <pubDate>Tue, 15 Jun 2021 07:50:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24170&amp;PID=78126&amp;title=bug-invalid-assert-in-cxtpfontdc-of-v19-3#78126</guid>
  </item> 
 </channel>
</rss>