<?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 : Report Control crash when deleting items</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Report Control crash when deleting items]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 17 Apr 2026 22:02:15 +0000</pubDate>
  <lastBuildDate>Thu, 19 Oct 2006 10:50:48 +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=5315</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[Report Control crash when deleting items :   JemeraldSoft wrote:I also tried...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16655&amp;title=report-control-crash-when-deleting-items#16655</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1801">rmercer</a><br /><strong>Subject:</strong> 5315<br /><strong>Posted:</strong> 19 October 2006 at 10:50am<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by JemeraldSoft" alt="Originally posted by JemeraldSoft" style="vertical-align: text-bottom;" /> <strong>JemeraldSoft wrote:</strong><br /><br />I also tried delete the row before deleting the record:<BR>m_lstAlarm.GetRows()-&gt;RemoveAt(i);<BR></td></tr></table> <DIV>I don't see anything wrong with your code, however I just noticed that&nbsp;you mentioned this is running in a seperate thread.&nbsp; I would guess that's where your issue is at.</DIV><DIV>&nbsp;</DIV><DIV>I've ran into this in the past where a&nbsp;thread removes records while the window thread is trying to process messages and is getting data that no longer exists.</DIV><DIV>&nbsp;</DIV><DIV>You will probably need to do your removes using a custom windows message or figure out a way to lock the control from updating while you're making your changes.</DIV><DIV>&nbsp;</DIV><DIV>To test the idea, can you just setup a WM_TIMER handler to run the code your thread would normally execute?&nbsp; Just fire up the timer to run every 500ms or something.&nbsp; I wouldn't recommend this as your actual solution, but it's a good way to confirm&nbsp;what's going on since everything will be processed in the same window thread.</DIV>]]>
   </description>
   <pubDate>Thu, 19 Oct 2006 10:50:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16655&amp;title=report-control-crash-when-deleting-items#16655</guid>
  </item> 
  <item>
   <title><![CDATA[Report Control crash when deleting items : I also tried delete the row before...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16638&amp;title=report-control-crash-when-deleting-items#16638</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2436">JemeraldSoft</a><br /><strong>Subject:</strong> 5315<br /><strong>Posted:</strong> 18 October 2006 at 6:36pm<br /><br />I also tried delete the row before deleting the record:<br>m_lstAlarm.GetRows()-&gt;RemoveAt(i);<br>]]>
   </description>
   <pubDate>Wed, 18 Oct 2006 18:36:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16638&amp;title=report-control-crash-when-deleting-items#16638</guid>
  </item> 
  <item>
   <title><![CDATA[Report Control crash when deleting items :  Yes I do, is the following code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16637&amp;title=report-control-crash-when-deleting-items#16637</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2436">JemeraldSoft</a><br /><strong>Subject:</strong> 5315<br /><strong>Posted:</strong> 18 October 2006 at 6:33pm<br /><br />Yes I do, is the following code right? or do I need to call Populate() after every RemoveAt():<br><br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;// delete the alarms associated with the disconnected server<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;for(int i = 0; i &lt; m_lstAlarm.GetRecords()-&gt;GetCount();)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CAlarmRecord * pRecord = (CAlarmRecord*)m_lstAlarm.GetRecords()-&gt;GetAt(i);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(pRecord &amp;&amp; pRecord-&gt;m_iHostId == pHost-&gt;m_hostId)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;m_lstAlarm.GetRecords()-&gt;RemoveAt(i);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;i++;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; m_lstAlarm.Populate();<br><br>]]>
   </description>
   <pubDate>Wed, 18 Oct 2006 18:33:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16637&amp;title=report-control-crash-when-deleting-items#16637</guid>
  </item> 
  <item>
   <title><![CDATA[Report Control crash when deleting items : Did you call Populate() after...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16636&amp;title=report-control-crash-when-deleting-items#16636</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1801">rmercer</a><br /><strong>Subject:</strong> 5315<br /><strong>Posted:</strong> 18 October 2006 at 3:21pm<br /><br />Did you call Populate() after you removed the record?<DIV>&nbsp;</DIV><DIV>m_lstAlarm.GetRecords()-&gt;RemoveAt(index);<BR>m_lstAlarm.Populate();</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 18 Oct 2006 15:21:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16636&amp;title=report-control-crash-when-deleting-items#16636</guid>
  </item> 
  <item>
   <title><![CDATA[Report Control crash when deleting items : Hi, I just started using the report...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16625&amp;title=report-control-crash-when-deleting-items#16625</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2436">JemeraldSoft</a><br /><strong>Subject:</strong> 5315<br /><strong>Posted:</strong> 18 October 2006 at 8:55am<br /><br />Hi, I just started using the report control in the toolkit in my application but found some issues with it.<br><br>Myapplication has some background thread that dynamically add/deleteentries to/from the report control. However, sometimes the controlcrashes when items are deleted. Deletion are done using (index is avalid index):<br><br>m_lstAlarm.GetRecords()-&gt;RemoveAt(index);<br><br>If I run it in the debug mode, I can see that the crashing happens in one of the following places:<br>1. drawing routine<br>2. tooltip routine<br>3. on mouse move<br><br>seems like it''s trying to access the deleted record.<br><br>Did I do something wrong.]]>
   </description>
   <pubDate>Wed, 18 Oct 2006 08:55:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=5315&amp;PID=16625&amp;title=report-control-crash-when-deleting-items#16625</guid>
  </item> 
 </channel>
</rss>