<?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 : GDI Resource leaks - CXTPDialogBaseImpl</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : GDI Resource leaks - CXTPDialogBaseImpl]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 22 May 2026 08:32:03 +0000</pubDate>
  <lastBuildDate>Wed, 18 Dec 2024 14:16:35 +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=24536</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[GDI Resource leaks - CXTPDialogBaseImpl : Artem,You are correct. I failed...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79097&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79097</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 18 December 2024 at 2:16pm<br /><br /><div>Artem,</div><div><br></div><div>You are correct. I failed to run our tool again while invoking our dialog multiple times after first seeing the GdiCursor entries. We do that second test to see if multiple entries build up. I just did so running three times and only one cursor entry showed up for each line instead of three. The handles that show up are constants so the system is not loading another cursor unless I destroy the previously loaded cursor.<br></div>]]>
   </description>
   <pubDate>Wed, 18 Dec 2024 14:16:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79097&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79097</guid>
  </item> 
  <item>
   <title><![CDATA[GDI Resource leaks - CXTPDialogBaseImpl : Hello,I&amp;#039;ve changed code by...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79096&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79096</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 18 December 2024 at 4:13am<br /><br />Hello,<br><br><div>I've changed code by calling GetGuiResources before and after LoadIcon/DestroyCursor/DestroyIcon and GetGuiResources returns same value before and after DestroyCursor/DestroyIcon functions. So this functions not clean GDI resources after LoadIcon call.</div><div><br></div><div><img src="uploads/9012/GDI_Resource_leaks_-_CXTPDialogBaseImpl.png" height="1160" width="1920" border="0" /><br></div><br>Next I've more detail checked MSDN documentation and found one thing: <br><br>https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroycursor<br>Remarks :<br>The DestroyCursor function destroys a nonshared cursor. Do not use this function to destroy a shared cursor. A shared cursor is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared cursor: LoadCursor...<br><br>https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroyicon<br>In remarks of DestroyIcon function wrore same.<br>Remarks:<br>It is only necessary to call DestroyIcon for icons and cursors created with the following functions: CreateIconFromResourceEx (if called without the LR_SHARED flag), CreateIconIndirect, and CopyIcon. Do not use this function to destroy a shared icon. A shared icon is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared icon. LoadIcon...<br><br><div>So I thik this is not a bug.</div><div><br></div><div>Regards,</div><div>Artem Gontarenko<br></div>]]>
   </description>
   <pubDate>Wed, 18 Dec 2024 04:13:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79096&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79096</guid>
  </item> 
  <item>
   <title><![CDATA[GDI Resource leaks - CXTPDialogBaseImpl : uploads/3213/CJLeak.zipVideo of...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79095&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79095</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 17 December 2024 at 10:43am<br /><br /><div><a href="uploads/3213/CJLeak.zip" target="_blank" rel="nofollow">uploads/3213/CJLeak.zip</a></div><div><br></div><div>Video of ISpy detecting GdiCursor leak in toolkit pro.<br></div>]]>
   </description>
   <pubDate>Tue, 17 Dec 2024 10:43:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79095&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79095</guid>
  </item> 
  <item>
   <title><![CDATA[GDI Resource leaks - CXTPDialogBaseImpl : We have a tool we wrote that hooks...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79094&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79094</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 17 December 2024 at 9:33am<br /><br /><div>We have a tool we wrote that hooks various APIs and tracks resource allocations. It uses debugging APIs to capture call stacks on allocation. When it lists any outstanding allocations we can double click an entry it shows on a call stack and it opens the source file in Visual Studio. It lets us start tracking and stop tracking on demand. So, I started tracking, brought up a dialog derived from the CJ class, closed the dialog and stopped tracking. Then I listed all outstanding resources and saw the "icon" resources and followed the stack and code.<br></div><div><br></div><div>I fixed this in the destructor by checking for non-null members and calling DestroyIcon. Just set a breakpoint in the constructor and destructor and you can see the allocation and see in the destructor the members are non null.<br></div>]]>
   </description>
   <pubDate>Tue, 17 Dec 2024 09:33:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79094&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79094</guid>
  </item> 
  <item>
   <title><![CDATA[GDI Resource leaks - CXTPDialogBaseImpl : How I can to reproduce this? ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79092&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79092</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 17 December 2024 at 4:22am<br /><br />How I can to reproduce this?<br>]]>
   </description>
   <pubDate>Tue, 17 Dec 2024 04:22:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79092&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79092</guid>
  </item> 
  <item>
   <title><![CDATA[GDI Resource leaks - CXTPDialogBaseImpl : Hello,What GDI resource leak tool...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79091&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79091</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 17 December 2024 at 4:20am<br /><br /><div>Hello,</div><div><br></div><div>What GDI resource leak tool you used for identifying resource leaks?</div><div><br></div><div>Regards,</div><div>Artem Gontarenko<br></div>]]>
   </description>
   <pubDate>Tue, 17 Dec 2024 04:20:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79091&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79091</guid>
  </item> 
  <item>
   <title><![CDATA[GDI Resource leaks - CXTPDialogBaseImpl : When constructing a dialog derived...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79090&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79090</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 24536<br /><strong>Posted:</strong> 16 December 2024 at 8:47am<br /><br /><div>When constructing a dialog derived from CXTPDialogBaseImpl the base class creates a CXTPCommandBars object. In its constructor a CXTPCustomizeDropSource object is created and in its constructor 3 icons are loaded. Our GDI resource leak tool is identifying these as resource leaks. I ran the tool because I noticed the GDI count going up in our process whenever we launch a dialog that uses this base class. Where is the DestroyIcon code supposed to go. Looks like it should be in destructor which is devoid of code.</div><div><br></div><div>CXTPCustomizeDropSource::CXTPCustomizeDropSource(CXTPCommandBars* pCommandBars)<br>{<br><font color="#ff0000">&nbsp;&nbsp;&nbsp; m_hcurDelete&nbsp;&nbsp; = XTPResourceManager()-&gt;LoadCursor(XTP_IDC_COMMANDBARS_DRAGDELETE);<br>&nbsp;&nbsp;&nbsp; m_hcurMove&nbsp;&nbsp;&nbsp;&nbsp; = XTPResourceManager()-&gt;LoadCursor(XTP_IDC_COMMANDBARS_DRAGMOVE);<br>&nbsp;&nbsp;&nbsp; m_hcurCopy&nbsp;&nbsp;&nbsp;&nbsp; = XTPResourceManager()-&gt;LoadCursor(XTP_IDC_COMMANDBARS_DRAGCOPY);<br></font>&nbsp;&nbsp;&nbsp; m_pSheet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = NULL;<br>&nbsp;&nbsp;&nbsp; m_pCommandBars = pCommandBars;<br><br>&nbsp;&nbsp;&nbsp; m_hwndCapture = 0;<br>&nbsp;&nbsp;&nbsp; m_pControl&nbsp;&nbsp;&nbsp; = 0;<br>&nbsp;&nbsp;&nbsp; m_bMove&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = FALSE;<br>&nbsp;&nbsp;&nbsp; m_bCopyOnly&nbsp;&nbsp; = FALSE;<br>&nbsp;&nbsp;&nbsp; m_pTarget&nbsp;&nbsp;&nbsp;&nbsp; = NULL;<br>}<br><br>CXTPCustomizeDropSource::~CXTPCustomizeDropSource()<br>{<br>}<br></div><div><br></div><div>This is in the current release.<br></div>]]>
   </description>
   <pubDate>Mon, 16 Dec 2024 08:47:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24536&amp;PID=79090&amp;title=gdi-resource-leaks-cxtpdialogbaseimpl#79090</guid>
  </item> 
 </channel>
</rss>