<?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 : Proper Destructi&#111;n Method for Dock Panes</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Proper Destructi&#111;n Method for Dock Panes]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 05:13:11 +0000</pubDate>
  <lastBuildDate>Tue, 03 May 2005 14:33:43 +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=2171</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[Proper Destructi&#111;n Method for Dock Panes : This is what I use:BOOL CMainF...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2171&amp;PID=6441&amp;title=proper-destruction-method-for-dock-panes#6441</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=203">Ark42</a><br /><strong>Subject:</strong> 2171<br /><strong>Posted:</strong> 03 May 2005 at 2:33pm<br /><br />This is what I use:<br><br>BOOL CMainFrame::DestroyPane(CXTPDockingPane *&amp;pPane)<br>{<br>&nbsp;&nbsp;&nbsp; if( pPane ) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pPane-&gt;Close();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CWnd *pWnd = pPane-&gt;GetChild();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if( pWnd ) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pWnd-&gt;DestroyWindow();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_paneManager.DestroyPane(pPane);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pPane = NULL;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return TRUE;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return FALSE;<br>}<br><br>]]>
   </description>
   <pubDate>Tue, 03 May 2005 14:33:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2171&amp;PID=6441&amp;title=proper-destruction-method-for-dock-panes#6441</guid>
  </item> 
  <item>
   <title><![CDATA[Proper Destructi&#111;n Method for Dock Panes : I was wondering if anyone out...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2171&amp;PID=6427&amp;title=proper-destruction-method-for-dock-panes#6427</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1143">umcbrad</a><br /><strong>Subject:</strong> 2171<br /><strong>Posted:</strong> 02 May 2005 at 11:08am<br /><br /><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I was wondering if anyone out there knew the correct or recommended method for destroying panes?&nbsp; The library does not seem to be very clear in this regard.&nbsp; The problem I have posted may be a bug in my code, but I would like to address theoretical issue here as well.</SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is my scenario.</SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Docking Panes and their child windows are created dynamically.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I create a new pane by calling PaneManager::CreatePane().<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I create a new CFrameWnd on the heap, then calling CFrameWnd::Create() and passing it a CRuntimeClass for the Doc and View.&nbsp; I do this on a user action to create a new pane.&nbsp; <o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Then I call CXTPDockingPane::Attach() in the OnDockingPane Notify() function. <o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><B><FONT face=Arial size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">Given this scenario, what is is the recommended method for removing and destroying a Docking Pane from the Manager and Docking Pane Layout List?<o:p></o:p></SPAN></FONT></B></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Keep in mind that I want to be able to dynamically create and destroy panes, and I want to destroy a pane and its associated child wnd when I close the pane.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Right now, I am trying to do this in response to the XTP_DPN_CLOSEPANE message.&nbsp; (or possibly the XTP_DPN_ACTION::xtpPaneActionClosed message).&nbsp; I try to call PaneManager::DestroyPane(), but I get a debug assertion failure,&nbsp; the framework routes to the DockingPaneLayout::DestroyPane() function, and then at the end it calls the CCmdTarget::InternalRelease() function.&nbsp; Here I where I get the failure, on this line:<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DWORD CCmdTarget::InternalRelease()</SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">{<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal style="TEXT-INDENT: 0.5in"><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ASSERT(GetInterfaceMap() != NULL);<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">.</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">.</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">.</SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have tried simply getting pointers the stack and list of panes from the manager, and then manually removing them from the data structures.&nbsp; This seems to work, however, I still have no easy way of destructing the pane, since it has a protected destructor.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Do I have a bug, or am I not doing this correctly?<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">It may also be helpful to know that I am attempting to save and restore layouts.<o:p></o:p></SPAN></FONT></P>]]>
   </description>
   <pubDate>Mon, 02 May 2005 11:08:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2171&amp;PID=6427&amp;title=proper-destruction-method-for-dock-panes#6427</guid>
  </item> 
 </channel>
</rss>