<?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 : Very very weird crash in Docking Pane!!</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Very very weird crash in Docking Pane!!]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 18:40:14 +0000</pubDate>
  <lastBuildDate>Thu, 29 Jul 2010 07:31:42 +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=16969</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[Very very weird crash in Docking Pane!! : Yes, this one agree :( Documentation...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59529&amp;title=very-very-weird-crash-in-docking-pane#59529</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 16969<br /><strong>Posted:</strong> 29 July 2010 at 7:31am<br /><br />Yes, this one agree :( Documentation is too bad.<br /><br />it always make pointer invalid, only Visual Studio not always crush application.]]>
   </description>
   <pubDate>Thu, 29 Jul 2010 07:31:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59529&amp;title=very-very-weird-crash-in-docking-pane#59529</guid>
  </item> 
  <item>
   <title><![CDATA[Very very weird crash in Docking Pane!! :  Hello OlegYes, that is what...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59516&amp;title=very-very-weird-crash-in-docking-pane#59516</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6154">elmue</a><br /><strong>Subject:</strong> 16969<br /><strong>Posted:</strong> 28 July 2010 at 11:01am<br /><br />Hello Oleg<br><br>Yes, that is what I found out after 3 days of searching:<br>that the order of commands matters.<br><br>But how can an ordinary programmer know that ?<br>There is absolutely no manual available that explains how to do such simple things like assigning icons to a pane.<br>The sample code that I saw that sets the icon in OnDockingPaneNotify() are a bad example beause the icon will only show after the pane has been activated for the first time.<br>So the logical consequence was that I modified the sample code to get a better behaviour.<br><br>And this change crashed the application.<br>So if it is not a bug it is a lack of documentation that makes programmers waste their time in searching the cause of strange crashes!<br><br>How can I know that a call to ExchangeLayout() makes the pointers invalid ?<br>And not even always !<br>Only sometimes!<br><br>Elmü<br>]]>
   </description>
   <pubDate>Wed, 28 Jul 2010 11:01:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59516&amp;title=very-very-weird-crash-in-docking-pane#59516</guid>
  </item> 
  <item>
   <title><![CDATA[Very very weird crash in Docking Pane!! : Hello,  Its not bug.  you load...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59506&amp;title=very-very-weird-crash-in-docking-pane#59506</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 16969<br /><strong>Posted:</strong> 28 July 2010 at 6:22am<br /><br />Hello,<br /><br />Its not bug. <br />you load old layout and it creates new panes pointers and deletes old. Now you can't call any methods of "paneClassView" - its not valid pointer now.<br /><br />So just move SetIconID line before your load old layout or restore pointer with m_panemanager.FindPane(ID) method and then access it.<br /><br />]]>
   </description>
   <pubDate>Wed, 28 Jul 2010 06:22:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59506&amp;title=very-very-weird-crash-in-docking-pane#59506</guid>
  </item> 
  <item>
   <title><![CDATA[Very very weird crash in Docking Pane!! :     HelloI invested 3 entire...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59371&amp;title=very-very-weird-crash-in-docking-pane#59371</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6154">elmue</a><br /><strong>Subject:</strong> 16969<br /><strong>Posted:</strong> 17 July 2010 at 8:08pm<br /><br />Hello<br><br>I invested 3 entire days to solve a crash problem that suddenly appeared !<br><br>I started working on the sample GUI_VisualStudio and modified it to my needs.<br>In the last weeks I made several changes to that project until a few days ago I noticed very weired crashes.<br>These crashes were extremely difficult to reproduce and although I found a solution now it stays an enigma why they happened!<br><br><img src="uploads/20100717_202707_Crash.gif" height="224" width="449" border="0"><br><br>I noticed already at the beginning that the Xtreme Tookit is very fragile.<br>You make a little change and suddenly something stops working.<br>As I'm very wise <img src="http://forum.codejock.com/smileys/smiley2.gif" border="0" align="absmiddle"> I made a backup of my work every day because I knew that I will need it some day!<br>And I was right!<br>If I would not have had these backups I would NEVER EVER have figured out what caused these crashes.<br>I discovered them several days after the change that initially caused them because they are so difficult to reproduce.<br><br>So what I did was compiling all the older versions of my project and I found that version 17 does not crash while version 18 crashes.<br>(When I discovered it, I was working on version 26)<br>What did I change between my backup 17 and 18 ?<br>Nothing interesting. Only some minor things.<br>But one of these changes caused the crash:&nbsp; -&nbsp; something that I would NEVER have suspected.<br><br>The crashes were very weird because they appeared at different locations in the code.<br>But always in a destructor. (sometimes even in the destructor of CString !)<br>And always memory was corrupted.<br><br><br>But the callstack was not helpfull because the error has happened long before the crash killed the application.<br>So the callstack only confused me and led me to wrong assumptions.<br>The callstack had nothing to do with the location were the memory has got corrupted before.<br><br><br><img src="uploads/20100717_193101_CrashStacktrace.gif" height="496" width="951" border="0"><br><br>To reproduce the crash I had to move around the docking panes between 20 and 30 times and each time close and restart the application.<br>-- Sometimes it crashed when closing the application.<br>-- Sometimes it crashed when docking a pane to a new place.<br>-- Sometimes it crashed when opening the application.<br><br>The latter case was the worst.<br>When the crash happened while the program starts the only chance the user has, is to delete the settings XML file.<br>But who of my users will know that ??<br>They will call the support: The application crashes!<br>When I looked into the XML file I could not find anything corrupt.<br>The file looks sane.<br><br>So what was the difference between my version 17 and 18 ?<br>One of the minor changes was, that I specified the ID of the icon for the pane !!<br>That was all !<br>That was my fatal "error" !<br><br>But the command SeIconId() does nothing really interesting:<br><br><img src="uploads/20100717_194038_SetIc&#111;nId.gif" height="214" width="575" border="0"><br><br>I called this command in CMainFrame::OnCreate(),<br>but the crash happened in CMainFrame::RecalcLayout()<br>or sometimes in other places.<br><br>The reason for the different crash locations is that memory got corrupted and the code runs a while longer before the CPU comes to work with corrupt memory.<br><br>I have seen Codejock samples that set the icon ID in OnDockingPaneNotify() after attaching the pane.<br><br>pPane-&gt;Attach(&amp;m_wndResourceView);<br>pPane-&gt;SetIconID(ICON_ID);<br><br>The disadvantage is that when starting the app for the first time the icon stays invisible until the pane gets activated by the user.<br>I wanted to avoid that and moved the code to CMainFrame::OnCreate().....<br>.....and this had catastrophical consequences!<br><br>This shows how fragile the Toolkit is:<br>If you assign an icon ID at the wrong location the entire application crashes and will never start again.<br>But this only after moving docking panes around for at least 20 times !!!<br><br>For the programmers at Codejock I give a detailed explanation how to reproduce the bug so they will hopefully fix it:<br><br>In the sample GUIVisualStudio insert into CMainFrame::OnCreate() the following code at the following location:<br><br>_________________________________________________<br><br>&nbsp;&nbsp;&nbsp; if (px.LoadFromFile(m_strIniFileName))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPPropExchangeSection pxTaskPanel(px.GetSection(_T("TaskPanel")));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_wndTaskPanel.GetGroups()-&gt;DoPropExchange(&amp;pxTaskPanel);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPPropExchangeSection pxNormalLayout(px.GetSection(_T("NormalLayout")));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ExchangeLayout(&amp;pxNormalLayout);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_pFullScreenLayout = DYNAMIC_DOWNCAST(CXTPPropExchangeXMLNode, px.GetSection(_T("FullScreenLayout")));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ASSERT(m_pFullScreenLayout);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ResetToolboxItems();&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; }<br><br><b>&nbsp;&nbsp;&nbsp; UINT u32_Icons&#091;&#093; = { 520, 521, 523 };<br>&nbsp;&nbsp;&nbsp; XTPImageManager()-&gt;SetIcons(IDB_TOOLBOXICONS, u32_Icons, 3, CSize(16,16));<br>&nbsp;&nbsp;&nbsp; paneClassView-&gt;SetIconID(523);<br></b><br>&nbsp;&nbsp;&nbsp; CXTPImageManager* pImageManager = pCommandBars-&gt;GetImageManager();<br><br>&nbsp;&nbsp;&nbsp; pImageManager-&gt;InternalAddRef();<br>&nbsp;&nbsp;&nbsp; m_paneManager.SetImageManager(pImageManager);<br><br>__________________________________<br><br>The following code will also invoke the crash:<br><br><b>&nbsp;&nbsp;&nbsp; paneClassView-&gt;SetIconID(ID_FILE_SAVE);</b><br><br>although it is more difficult to reproduce with this code.<br>__________________________________<br><br>To make it easier for you so you must not move around the panes 30 times, copy this XML file into your Bin directory:<br><br><a href="uploads/20100717_195048_GUI_VisualStudi.zip" target="_blank">uploads/20100717_195048_GUI_VisualStudi.zip</a><br><br>When you add this one line of code and copy the XML file it will crash.<br>When you remove the line of code the SAME XML file works fine !<br><br><br>I Hope you will fix this bug that wasted 3 entire days of my life !!<br><br>Elmü<br><br><br><br>]]>
   </description>
   <pubDate>Sat, 17 Jul 2010 20:08:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16969&amp;PID=59371&amp;title=very-very-weird-crash-in-docking-pane#59371</guid>
  </item> 
 </channel>
</rss>