<?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 : Crash on TrackPopupMenu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Crash on TrackPopupMenu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 22:51:27 +0000</pubDate>
  <lastBuildDate>Thu, 07 Sep 2006 14:01:23 +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=4971</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[Crash on TrackPopupMenu : Hello,  if AfxGetThread returns...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15527&amp;title=crash-on-trackpopupmenu#15527</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 4971<br /><strong>Posted:</strong> 07 September 2006 at 2:01pm<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>if AfxGetThread returns NULL it means that AfxGetApp will return NULL also. and&nbsp;this means something wrong with initialization/swiching MFC.</DIV>]]>
   </description>
   <pubDate>Thu, 07 Sep 2006 14:01:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15527&amp;title=crash-on-trackpopupmenu#15527</guid>
  </item> 
  <item>
   <title><![CDATA[Crash on TrackPopupMenu : I&amp;#039;m sorry I wasn&amp;#039;t clear...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15475&amp;title=crash-on-trackpopupmenu#15475</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1714">karim</a><br /><strong>Subject:</strong> 4971<br /><strong>Posted:</strong> 05 September 2006 at 3:49pm<br /><br />I'm sorry I wasn't clear about that.&nbsp; Yeah, I am switching state but it makes no difference.&nbsp; Specifically, I'm calling <br><table width="99%"><tr><td><pre class="BBcode">AFX_MANAGE_STATE(AfxGetStaticModuleState());</pre></td></tr></table> at the top of the function.&nbsp; And besides, since the menu resource is loading fine, that seems to indicate that the module state is correct at least to some extent.&nbsp; <br><br>Can CXTPCommandBars::TrackPopupMenu be called anywhere or are there certain restrictions?&nbsp; I don't know what they would be, but...<br><br>Thanks,<br>Karim<br><br><br>]]>
   </description>
   <pubDate>Tue, 05 Sep 2006 15:49:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15475&amp;title=crash-on-trackpopupmenu#15475</guid>
  </item> 
  <item>
   <title><![CDATA[Crash on TrackPopupMenu : Yes, you have to switch state...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15469&amp;title=crash-on-trackpopupmenu#15469</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 4971<br /><strong>Posted:</strong> 05 September 2006 at 3:07pm<br /><br />Yes, you have to switch state in your dll.]]>
   </description>
   <pubDate>Tue, 05 Sep 2006 15:07:39 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15469&amp;title=crash-on-trackpopupmenu#15469</guid>
  </item> 
  <item>
   <title><![CDATA[Crash on TrackPopupMenu :  I&amp;#039;m seeing a crash when...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15466&amp;title=crash-on-trackpopupmenu#15466</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1714">karim</a><br /><strong>Subject:</strong> 4971<br /><strong>Posted:</strong> 05 September 2006 at 12:59pm<br /><br />I'm seeing a crash when I call the static version of CXTPCommandBars::TrackPopupMenu where the first parameter is the CMenu pointer.&nbsp; This call is being made inside a DLL that dynamically links to MFC(and Codejock). &nbsp; It's crashing in the function below and I believe the problem is AfxGetThread is returning NULL.&nbsp; I think it's a manage state problem, but the message is originating from a control in the dll - the call isn't being made from the executable.<br><br>Thanks,<br>Karim<br><br><table width="99%"><tr><td><pre class="BBcode"><br>void CXTPPopupBar::PumpMessage()<br>{<br><br>&nbsp;&nbsp;&nbsp; while (IsTrackingMode())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MSG msg;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (::GetMessage(&amp;msg, NULL, NULL, NULL))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!IsTrackingMode())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ::PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (msg.message != WM_KICKIDLE &amp;&amp; !AfxGetThread()-&gt;PreTranslateMessage(&amp;msg))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // process this message<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ::TranslateMessage(&amp;msg);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ::DispatchMessage(&amp;msg);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; }<br>}<br></pre></td></tr></table><br><br><br>]]>
   </description>
   <pubDate>Tue, 05 Sep 2006 12:59:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4971&amp;PID=15466&amp;title=crash-on-trackpopupmenu#15466</guid>
  </item> 
 </channel>
</rss>