<?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 : CustomControl &amp; CXTPControlLabel</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : CustomControl &amp; CXTPControlLabel]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 17:23:01 +0000</pubDate>
  <lastBuildDate>Wed, 19 May 2010 11:39: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=16716</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[CustomControl &amp; CXTPControlLabel : I guess your control receives...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16716&amp;PID=58575&amp;title=customcontrol-cxtpcontrollabel#58575</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 16716<br /><strong>Posted:</strong> 19 May 2010 at 11:39am<br /><br />I guess your control receives WM_PAINT, and is then deleted from elsewhere - destroying your markup context. In debug-mode the memory stays intact, but in release mode it is probably zeroed out or altered by some other memory allocation. <DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Make sure your custom control HWND is destroyed before the destructor is called:</DIV><DIV>&nbsp;</DIV><DIV>CMainFrame::OnDestroy()</DIV><DIV>{</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; m_customWindowCtrl.DestroyWindow();</DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 19 May 2010 11:39:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16716&amp;PID=58575&amp;title=customcontrol-cxtpcontrollabel#58575</guid>
  </item> 
  <item>
   <title><![CDATA[CustomControl &amp; CXTPControlLabel : Hello,i&amp;#039;ve a Control based...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16716&amp;PID=58538&amp;title=customcontrol-cxtpcontrollabel#58538</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 16716<br /><strong>Posted:</strong> 18 May 2010 at 7:23am<br /><br />Hello,<br><br>i've a&nbsp; Control based on CXTPControlCustom<br><br>On Painting of my control, i use&nbsp; the CXTPControlLabel class<br>to draw a label into my control<br><br>class CXTPControlLabelHelper : public CXTPControlLabel<br>{<br>public:<br>&nbsp;&nbsp;&nbsp; virtual void SetParent(CXTPCommandBar* pParent)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; __super::SetParent(pParent);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; void SetType(XTPControlType type)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_controlType = type;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_bSelected = TRUE;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; virtual int GetSelected() const<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return m_bSelected;<br>&nbsp;&nbsp;&nbsp; }<br>};<br><br>void MyControl::OnPaint()<br>{<br>....<br>&nbsp;&nbsp;&nbsp; CXTPControlLabelHelper label;<br>&nbsp;&nbsp;&nbsp; label.SetCaption(strText);<br>&nbsp;&nbsp;&nbsp; label.SetParent(m_pControl-&gt;GetParent());<br>&nbsp;&nbsp;&nbsp; if (m_pControl-&gt;IsFocused())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; label.SetType(xtpControlCustom);<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Codejock bei ThemeRibbon hotfix<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!m_pControl-&gt;GetPaintManager()-&gt;m_bOffsetPopupLabelText)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rcText.left += nGripperWidth;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; label.SetRect(rcText);<br>&nbsp;&nbsp;&nbsp; m_pControl-&gt;GetPaintManager()-&gt;DrawControlPopupParent(&amp;dc, &amp;label, TRUE);<br>}<br><br>m_pControl is a pointer to my CXTPControlCustom object.<br><br>In Debug it work correct. <br>But in release it crash in CXTPControlLabel destructor.<br><br>Here is the callstack<br>&nbsp;&nbsp;&nbsp;&nbsp; mfc71.dll!CCmdTarget::ExternalQueryInterface(const void * iid=0x774b1a80, void * * ppvObj=0x0012ebb0)&nbsp; Zeile 332&nbsp;&nbsp;&nbsp; C++<br>&nbsp;&nbsp;&nbsp;&nbsp; ToolkitPro1400vc71.dll!CXTPAccessible::XAccessible::QueryInterface()&nbsp; + 0x1e&nbsp;&nbsp;&nbsp; C++<br>&nbsp;&nbsp;&nbsp;&nbsp; ole32.dll!_CoDisconnectObject@8()&nbsp; + 0x4a&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; mfc71.dll!CCmdTarget::ExternalDisconnect()&nbsp; Zeile 396&nbsp;&nbsp;&nbsp; C++<br>&nbsp;&nbsp;&nbsp;&nbsp; mfc71.dll!CCmdTarget::~CCmdTarget()&nbsp; Zeile 51&nbsp;&nbsp;&nbsp; C++<br>&nbsp;&nbsp;&nbsp;&nbsp; ToolkitPro1400vc71.dll!CXTPControl::~CXTPControl()&nbsp; + 0x104&nbsp;&nbsp;&nbsp; C++<br>&nbsp;&nbsp;&nbsp;&nbsp; Lasal2.exe!CMarkupFilterCtrl::OnPaint()&nbsp; Zeile 270 + 0x12&nbsp;&nbsp;&nbsp; C++<br><br>i use VS.NET 2003 &amp; CJ V14.0.0beta<br><br>&nbsp; Jimmy<br><br>&nbsp; <br>]]>
   </description>
   <pubDate>Tue, 18 May 2010 07:23:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16716&amp;PID=58538&amp;title=customcontrol-cxtpcontrollabel#58538</guid>
  </item> 
 </channel>
</rss>