<?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 : CXTPTaskDialog dynamic allocation and deletion</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPTaskDialog dynamic allocation and deletion]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 09:10:36 +0000</pubDate>
  <lastBuildDate>Sat, 12 Apr 2008 01:55:27 +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=10177</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[CXTPTaskDialog dynamic allocation and deletion : Hi,  Well, I am not sure about...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33544&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33544</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3475">solo</a><br /><strong>Subject:</strong> 10177<br /><strong>Posted:</strong> 12 April 2008 at 1:55am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Well, I am not sure about the exact problem but I agree that the problem shouldn't be with the heap if PostNcDestroy is not called rather it should a simple memory leak. Seems like I am messing up&nbsp;the threads in my application. I will&nbsp;try&nbsp;to&nbsp;resolve the issue&nbsp;and complete this thread by mentioning my mistake.</DIV><DIV>&nbsp;</DIV><DIV>Thanks a lot for help (everybody).</DIV>]]>
   </description>
   <pubDate>Sat, 12 Apr 2008 01:55:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33544&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33544</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTaskDialog dynamic allocation and deletion : Hi Solo;  Another suggestion:  What...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33462&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33462</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 10177<br /><strong>Posted:</strong> 11 April 2008 at 2:20am<br /><br />Hi Solo;<DIV>&nbsp;</DIV><DIV>Another suggestion:</DIV><DIV>&nbsp;</DIV><DIV>What about using a std::auto_ptr&lt;CWaitDialog&gt; member in the parent class of your dialog?</DIV>]]>
   </description>
   <pubDate>Fri, 11 Apr 2008 02:20:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33462&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33462</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTaskDialog dynamic allocation and deletion : Hi Oleg;  but wouldn&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33461&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33461</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 10177<br /><strong>Posted:</strong> 11 April 2008 at 1:51am<br /><br />Hi Oleg;<DIV>&nbsp;</DIV><DIV>but wouldn't this result in a memory leak instead of a heap corruption?</DIV>]]>
   </description>
   <pubDate>Fri, 11 Apr 2008 01:51:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33461&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33461</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTaskDialog dynamic allocation and deletion : Hi, Problem can be with virtual...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33450&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33450</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 10177<br /><strong>Posted:</strong> 11 April 2008 at 1:02am<br /><br />Hi,<DIV>Problem can be with <FONT size=2><FONT color=#0000ff>virtual</FONT> <FONT color=#0000ff>void</FONT> <FONT color=#010001>PostNcDestroy</FONT>()</DIV><DIV></DIV>In Vista we use System TaskDialog - and <FONT color=#010001>PostNcDestroy will be never called.</FONT></FONT>]]>
   </description>
   <pubDate>Fri, 11 Apr 2008 01:02:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33450&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33450</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTaskDialog dynamic allocation and deletion : Hi;  Can you show the call stack...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33436&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33436</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 10177<br /><strong>Posted:</strong> 10 April 2008 at 3:07pm<br /><br />Hi;<DIV>&nbsp;</DIV><DIV>Can you show the call stack when the app core dumps; where and how is m_pWaitDlg constructed?</DIV>]]>
   </description>
   <pubDate>Thu, 10 Apr 2008 15:07:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33436&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33436</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTaskDialog dynamic allocation and deletion : Hi,  What is wrong with this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33434&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33434</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3475">solo</a><br /><strong>Subject:</strong> 10177<br /><strong>Posted:</strong> 10 April 2008 at 2:20pm<br /><br /><DIV>Hi,</DIV><DIV>&nbsp;</DIV><DIV>What is wrong with this class.</DIV><DIV>&nbsp;</DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2>class</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CWaitDialog</FONT><FONT size=2> : </FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CXTPTaskDialog</P></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2>:</P><P></FONT><FONT color=#010001 size=2>CWaitDialog</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>CWnd</FONT><FONT size=2>* </FONT><FONT color=#010001 size=2>pWndParent</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>CString</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>csTitle</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>CString</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>csInstruction</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>LPCWSTR</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pszIconResource</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>TD_INFORMATION_ICON</FONT><FONT size=2>)</P><P>: </FONT><FONT color=#010001 size=2>CXTPTaskDialog</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>pWndParent</FONT><FONT size=2>)</P><P>{</P><P></FONT><FONT color=#010001 size=2>SetWindowTitle</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>csTitle</FONT><FONT size=2>);</P><P></FONT><FONT color=#010001 size=2>SetMainInstruction</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>csInstruction</FONT><FONT size=2>);</P><P></FONT><FONT color=#010001 size=2>SetMainIcon</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>pszIconResource</FONT><FONT size=2>);</P><P></FONT><FONT color=#010001 size=2>SetCommonButtons</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>TDCBF_CANCEL_BUTTON</FONT><FONT size=2>);</P><P></FONT><FONT color=#010001 size=2>ShowProgressBar</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>TRUE</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>TRUE</FONT><FONT size=2>);</P><P>}</P><P></FONT><FONT color=#0000ff size=2>virtual</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>OnDialogConstructed</FONT><FONT size=2>()</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (</FONT><FONT color=#010001 size=2>m_config</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>dwFlags</FONT><FONT size=2> &amp; </FONT><FONT color=#010001 size=2>TDF_SHOW_PROGRESS_BAR</FONT><FONT size=2>)</P><P></FONT><FONT color=#010001 size=2>SetProgressBarPos</FONT><FONT size=2>(60);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (</FONT><FONT color=#010001 size=2>m_config</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>dwFlags</FONT><FONT size=2> &amp; </FONT><FONT color=#010001 size=2>TDF_SHOW_MARQUEE_PROGRESS_BAR</FONT><FONT size=2>)</P><P></FONT><FONT color=#010001 size=2>StartProgressBarMarquee</FONT><FONT size=2>(1, 50);</P><P></FONT><FONT color=#010001 size=2>EnableButton</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>IDCANCEL</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>FALSE</FONT><FONT size=2>);</P><P>}</P><P></FONT><FONT color=#0000ff size=2>virtual</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>PostNcDestroy</FONT><FONT size=2>()</P><P>{</P><P></FONT><FONT color=#008000 size=2>// TODO: Add your specialized code here and/or call the base class</P></FONT><FONT size=2><P></FONT><FONT color=#010001 size=2>CXTPTaskDialog</FONT><FONT size=2>::</FONT><FONT color=#010001 size=2>PostNcDestroy</FONT><FONT size=2>();</P><P></FONT><FONT color=#008000 size=2>// Release resources from heap</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>;</P><P>}</P><P>}</FONT><FONT size=2>;</P><DIV></DIV><P>When I call <FONT color=#010001 size=2></P><P>m_pWaitDlg</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>ClickButton</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>IDCANCEL</FONT><FONT size=2>);</P></FONT><P>where m_pWaitDlg is the pointer to the object created in heap, every thing seems fine. But when I close my main application, the debugger open free.c and shows me this line.</P><DIV></DIV><DIV></DIV><FONT size=2><P></FONT><FONT color=#010001 size=2>retval</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>HeapFree</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>_crtheap</FONT><FONT size=2>, 0, </FONT><FONT color=#010001 size=2>pBlock</FONT><FONT size=2>); &#091;Line 109&#093;</P><DIV>What is the problem. Why is there a corruption in heap. </DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV></FONT></FONT>]]>
   </description>
   <pubDate>Thu, 10 Apr 2008 14:20:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10177&amp;PID=33434&amp;title=cxtptaskdialog-dynamic-allocation-and-deletion#33434</guid>
  </item> 
 </channel>
</rss>