<?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 : Changing text in Statusbar pane from timer event</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Changing text in Statusbar pane from timer event]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 08:22:38 +0000</pubDate>
  <lastBuildDate>Tue, 24 Mar 2009 12:13:52 +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=13743</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[Changing text in Statusbar pane from timer event : Sorry for going on about threads,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=47044&amp;title=changing-text-in-statusbar-pane-from-timer-event#47044</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3717">Smucker</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 24 March 2009 at 12:13pm<br /><br />Sorry for going on about threads, I thought it was the simple SetTimer since you were only using for updating.<br><br>APCs can cause reentrancy problems that are very similar to thread issues. Glad you got it sorted out!<br><br>]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 12:13:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=47044&amp;title=changing-text-in-statusbar-pane-from-timer-event#47044</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : Thanks for the further info, Phillip. It...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=47029&amp;title=changing-text-in-statusbar-pane-from-timer-event#47029</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 24 March 2009 at 6:57am<br /><br />Thanks for the further info, Phillip.<br />It looks like this was indeed the issue (using an asynchronous timer).  Trying your debugging suggestions, pointed the issue as  being a threading issue.<br /><br />The timer I'm using is a 3rd party high accuracy timer, and it can be ran either synchronously or asynchronously.<br />After changing all instances of it to run synchronously, all the crashes have stopped.  I tried decreasing the interval time as you suggested and running synchronously, and still no crashes.<br /><br />Switching the 3rd party to synchronous mode won't affect the accuracy of the timer, but may slightly affect the accuracy when the UI thread receives the regular messages, which is OK for my purposes.<br /><br />Thanks again for the info and suggestions.<br /><br /><br /><br /><br /><br />]]>
   </description>
   <pubDate>Tue, 24 Mar 2009 06:57:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=47029&amp;title=changing-text-in-statusbar-pane-from-timer-event#47029</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : If WM_TIMER (and the call to SetText)...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46999&amp;title=changing-text-in-statusbar-pane-from-timer-event#46999</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3717">Smucker</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 23 March 2009 at 9:33am<br /><br />If WM_TIMER (and the call to SetText) are in a different thread than the one that paints the status pane (and calls GetText), I think you have a race condition in CString handling. Debug code takes more cycles so is sometimes more likely to cause the issue. I guess it could also include non-thread-safe code not in the release compile, but that would be weird. (SetTimer() is never asynchronous; supplying a routine simply automates calling the TimerProc from the default window proc, rather than having to handle WM_TIMER.)<br><br>Your stack trace above is from the drawing thread; check your other threads' stacks for calls to CXTPStatusBarPane methods. Also, double-click on the GetText() line and examine <font color="#0033ff">this-&gt;m_strText</font>.<br><br>Also, what exception is being reported?<br><br><br>Another idea: change your timer to 10 to 50 ms and see if you can get it to crash quicker, and maybe in release mode. I assume you have at least a dual-core system; single-core systems hide (or make much rarer) a lot of multithreading issues.<br><br><br>]]>
   </description>
   <pubDate>Mon, 23 Mar 2009 09:33:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46999&amp;title=changing-text-in-statusbar-pane-from-timer-event#46999</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : UPDATE: It seems I missed another...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46998&amp;title=changing-text-in-statusbar-pane-from-timer-event#46998</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 23 March 2009 at 9:17am<br /><br />UPDATE:<br />It seems I missed another part of my code where I was setting the timer asynchronously.  I changed this so that it is now using the timer synchronously, and so far, I haven't had any crashes.&nbsp;&nbsp;&nbsp;So, it looks like this may have been the problem after all.<br />Thanks Phillip, and also Oleg and znakeeye for looking into this.  <br /><br />I'll update this message thread after a couple of days of testing, to inform everyone if setting the timer to work synchronously has indeed fixed the issue.]]>
   </description>
   <pubDate>Mon, 23 Mar 2009 09:17:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46998&amp;title=changing-text-in-statusbar-pane-from-timer-event#46998</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : Thanks for the suggestion and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46997&amp;title=changing-text-in-statusbar-pane-from-timer-event#46997</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 23 March 2009 at 8:18am<br /><br />Thanks for the suggestion and info, Phillip.  The timer I'm using can be used either synchronously or asynchronously, and I've been using it asynchronously.  I just changed it to work synchronously (with the main UI thread) and the crash is still occuring.  <br /><br />I think you may be correct about the issue being related to the threads though.  If the pane is redrawn in a separate thread (is this true, Oleg?), it may be trying to redraw the pane at the same time I'm updating the text in that pane.&nbsp;&nbsp;&nbsp;What is puzzling is that the issue only seems to be occuring in debug mode.  I haven't had a crash (yet) in the release build.<br />]]>
   </description>
   <pubDate>Mon, 23 Mar 2009 08:18:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46997&amp;title=changing-text-in-statusbar-pane-from-timer-event#46997</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : Are you setting pane text from...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46995&amp;title=changing-text-in-statusbar-pane-from-timer-event#46995</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3717">Smucker</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 23 March 2009 at 7:18am<br /><br /> Are you setting pane text from a separate thread? If so, the setting of the pane's CString may be occurring simultaneously with its use by another thread. When the crash occurs, check the other threads to see if CXTPStatusBarPane::SetText is on the stack.<br><br>I usually concentrate all the UI in the main thread, and post messages from other threads for updates, and use synchronization for any objects shared between threads.<br><br>]]>
   </description>
   <pubDate>Mon, 23 Mar 2009 07:18:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46995&amp;title=changing-text-in-statusbar-pane-from-timer-event#46995</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : I use...  CXTPStatusBarPane* pPane...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46993&amp;title=changing-text-in-statusbar-pane-from-timer-event#46993</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 23 March 2009 at 6:01am<br /><br />I use...<br /><font face="Arial, Helvetica, sans-serif"><br />CXTPStatusBarPane* pPane = pStatusBar-&gt;FindPane(myPane);<br />assert(pPane);<br />pPane-&gt;SetText(myText.c_str());<br /></font><br /><br />.. where myText is a std::string.<br /><br />]]>
   </description>
   <pubDate>Mon, 23 Mar 2009 06:01:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46993&amp;title=changing-text-in-statusbar-pane-from-timer-event#46993</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : Hi, How you set text ? ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46983&amp;title=changing-text-in-statusbar-pane-from-timer-event#46983</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 23 March 2009 at 1:59am<br /><br />Hi,<DIV>How you set text ?</DIV>]]>
   </description>
   <pubDate>Mon, 23 Mar 2009 01:59:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46983&amp;title=changing-text-in-statusbar-pane-from-timer-event#46983</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : No, I&amp;#039;m running xp.   So...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46950&amp;title=changing-text-in-statusbar-pane-from-timer-event#46950</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4354">mitcheljh</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 20 March 2009 at 10:33am<br /><br />No, I'm running xp.  <br />So far, I'm only seeing the issue in the debug build. <br />Also, it mainly happens when I'm working in another application.  When the application containing the status bar that get's updated has focus, the crash doesn't seem to occur.  It could be that I just haven't witnessed it occurring when it has the focus, though.]]>
   </description>
   <pubDate>Fri, 20 Mar 2009 10:33:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46950&amp;title=changing-text-in-statusbar-pane-from-timer-event#46950</guid>
  </item> 
  <item>
   <title><![CDATA[Changing text in Statusbar pane from timer event : Are you running Vista? I had a...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46946&amp;title=changing-text-in-statusbar-pane-from-timer-event#46946</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 13743<br /><strong>Posted:</strong> 20 March 2009 at 10:00am<br /><br />Are you running Vista? I had a similar crash (with&nbsp;a popup-menu)&nbsp;which only occurred in Vista.]]>
   </description>
   <pubDate>Fri, 20 Mar 2009 10:00:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13743&amp;PID=46946&amp;title=changing-text-in-statusbar-pane-from-timer-event#46946</guid>
  </item> 
 </channel>
</rss>