<?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 : CMarkupTreeCtrl::SetItemText...</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : CMarkupTreeCtrl::SetItemText...]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 00:05:18 +0000</pubDate>
  <lastBuildDate>Mon, 07 Sep 2009 06:38:23 +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=15120</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[CMarkupTreeCtrl::SetItemText... : Hi, Don&amp;#039;t think Microsoft...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52837&amp;title=cmarkuptreectrlsetitemtext#52837</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 15120<br /><strong>Posted:</strong> 07 September 2009 at 6:38am<br /><br /><P>Hi,</P><DIV>Don't think Microsoft do this, but guess you have to test it.</DIV>]]>
   </description>
   <pubDate>Mon, 07 Sep 2009 06:38:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52837&amp;title=cmarkuptreectrlsetitemtext#52837</guid>
  </item> 
  <item>
   <title><![CDATA[CMarkupTreeCtrl::SetItemText... : Thanks!    Btw, is thecall...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52835&amp;title=cmarkuptreectrlsetitemtext#52835</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 15120<br /><strong>Posted:</strong> 07 September 2009 at 6:26am<br /><br />Thanks!<DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Btw, is the&nbsp;call to SetItemData(NULL) dangerous or can you assume that WM_PAINT is not sent at&nbsp;this time?</DIV>]]>
   </description>
   <pubDate>Mon, 07 Sep 2009 06:26:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52835&amp;title=cmarkuptreectrlsetitemtext#52835</guid>
  </item> 
  <item>
   <title><![CDATA[CMarkupTreeCtrl::SetItemText... : Hi,  Call MARKUP_RELEASE(pOldElement)...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52774&amp;title=cmarkuptreectrlsetitemtext#52774</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 15120<br /><strong>Posted:</strong> 04 September 2009 at 11:08am<br /><br /><P>Hi,</P><DIV>&nbsp;</DIV><DIV>Call MARKUP_RELEASE(pOldElement) or XTPMarkupReleaseElement();</DIV>]]>
   </description>
   <pubDate>Fri, 04 Sep 2009 11:08:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52774&amp;title=cmarkuptreectrlsetitemtext#52774</guid>
  </item> 
  <item>
   <title><![CDATA[CMarkupTreeCtrl::SetItemText... :  Consider this:  HTREEITEM...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52769&amp;title=cmarkuptreectrlsetitemtext#52769</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 15120<br /><strong>Posted:</strong> 04 September 2009 at 9:55am<br /><br /><FONT color=#010001 size=2><FONT color=#010001 size=2><DIV>Consider this:</DIV><DIV>&nbsp;</DIV><DIV>HTREEITEM</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>CMarkupTreeCtrl</FONT></FONT><FONT size=2>::</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>AddItem</FONT></FONT><FONT size=2>(</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>LPCTSTR</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>lpszItem</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>nImage</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>nSelectedImage</FONT></FONT><FONT size=2>, </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>HTREEITEM</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>hParent</FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>/* = TVI_ROOT*/</FONT></FONT><FONT size=2>, </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>HTREEITEM</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>hInsertAfter</FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>/* = TVI_LAST*/</FONT></FONT><FONT size=2>)</DIV><DIV>{</DIV><DIV>&nbsp;&nbsp;&nbsp; C</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>XTPMarkupUIElement</FONT></FONT><FONT size=2>* </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2><strong>pUIElement</strong></FONT></FONT><FONT size=2> = </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>Parse</FONT></FONT><FONT size=2>(</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>lpszItem</FONT></FONT><FONT size=2>);</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp; ...</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Now I want to update the text, so I implemented SetItemText. The problem is: how do I free the memory held by the previous C<FONT color=#010001 size=2><FONT color=#010001 size=2>XTPMarkupUIElement object? <strong>The destructor is private!</strong></FONT></FONT></FONT></DIV><DIV><FONT color=#010001 size=2></FONT>&nbsp;</DIV><DIV><FONT color=#010001 size=2>----------------------------------------------------------------------------------------</FONT></DIV><DIV>BOOL CMarkupTreeCtrl::SetItemText(HTREEITEM hItem, LPCTSTR lpszItem)<BR>{<BR>&nbsp;&nbsp;&nbsp; CXTPMarkupUIElement* pOldElement = (CXTPMarkupUIElement*)GetItemData(hItem);<BR>&nbsp;&nbsp;&nbsp; SetItemData(hItem, NULL); <strong>// Not sure if this is necessary?</strong><BR>&nbsp;&nbsp;&nbsp; <strong>// FREE pOldElement??</strong></DIV><DIV><strong></strong>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; BOOL retVal = FALSE;<BR>&nbsp;&nbsp;&nbsp; CXTPMarkupUIElement* pUIElement = Parse(lpszItem);<BR>&nbsp;&nbsp;&nbsp; if (pUIElement)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; retVal = CXTTreeCtrl::SetItemText(hItem, GetInnerText(pUIElement));<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; retVal = CXTTreeCtrl::SetItemText(hItem, lpszItem);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; SetItemData(hItem, (DWORD_PTR)pUIElement);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; return retVal;<BR>}</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 04 Sep 2009 09:55:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15120&amp;PID=52769&amp;title=cmarkuptreectrlsetitemtext#52769</guid>
  </item> 
 </channel>
</rss>