<?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 : App Hangs in CXTPSoundManager</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : App Hangs in CXTPSoundManager]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 03:56:55 +0000</pubDate>
  <lastBuildDate>Thu, 15 Nov 2018 05:05:38 +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=22888</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[App Hangs in CXTPSoundManager : Am I really the only one having...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=77144&amp;title=app-hangs-in-cxtpsoundmanager#77144</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 15 November 2018 at 5:05am<br /><br />Am I really the only one having this problem?<div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div>void CXTPSoundManager::StopThread()</div><div>{</div><div>&nbsp; if (NULL != m_hThread)</div><div>&nbsp; {</div><div>&nbsp; &nbsp; // start changed code</div><div>&nbsp; &nbsp; PostThreadMessage(m_dwThreadId, WM_QUIT, 0, 0);</div><div>&nbsp; &nbsp; DWORD dwCount = 0, dwExitCode = 0;</div><div>&nbsp; &nbsp; while (GetExitCodeThread(m_hThread, &amp;dwExitCode) &amp;&amp; dwExitCode == STILL_ACTIVE)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; dwCount++;</div><div>&nbsp; &nbsp; &nbsp; if (dwCount &gt; 10)</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TerminateThread(m_hThread, 0);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; ::WaitForSingleObject(m_hThread, 100);</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; // end changed code</div><div><br></div><div>&nbsp; &nbsp; // start changed code</div><div>&nbsp; &nbsp; // PostThreadMessage(m_dwThreadId, WM_QUIT, 0, 0);</div><div>&nbsp; &nbsp; // ::WaitForSingleObject(m_hThread, INFINITE);</div><div>&nbsp; &nbsp; // end changed code</div><div><br></div><div>&nbsp; &nbsp; ::CloseHandle(m_hThread);</div><div>&nbsp; &nbsp; m_hThread = 0;</div><div>&nbsp; &nbsp; m_dwThreadId = 0;</div><div>&nbsp; }</div><div>}</div></div><div></pre></td></tr></table></div><div><br></div><div>The PostThreadMessage does not get through unless a Sleep or WaitForSingleObject is forcing a thread shift? The correction above works in all cases also when freeing a DLL.</div><div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Thu, 15 Nov 2018 05:05:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=77144&amp;title=app-hangs-in-cxtpsoundmanager#77144</guid>
  </item> 
  <item>
   <title><![CDATA[App Hangs in CXTPSoundManager : Anyone looked at this problem?-cpede...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=75150&amp;title=app-hangs-in-cxtpsoundmanager#75150</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 26 September 2016 at 10:26am<br /><br />Anyone looked at this problem?<div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Mon, 26 Sep 2016 10:26:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=75150&amp;title=app-hangs-in-cxtpsoundmanager#75150</guid>
  </item> 
  <item>
   <title><![CDATA[App Hangs in CXTPSoundManager : This problem still exist in v1720.My...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=75010&amp;title=app-hangs-in-cxtpsoundmanager#75010</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 25 August 2016 at 10:34am<br /><br />This problem still exist in v1720.<div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">My call-stack looks like this:</span></div><div><img src="uploads/686/XTPSoundManager_Hang.png" height="570" width="299" border="0" /></div><div><br></div><div>It happens when I try to unload a DLL using ::FreeLibrary.</div><div><br></div><div>Just noted this parallel thread:</div><div><img src="uploads/686/XTPSoundManager_Hang_2.png" height="142" width="268" border="0" /><br></div><div><br></div><div>Could that cause some kind of lock?</div><div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Thu, 25 Aug 2016 10:34:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=75010&amp;title=app-hangs-in-cxtpsoundmanager#75010</guid>
  </item> 
  <item>
   <title><![CDATA[App Hangs in CXTPSoundManager : I can see that the code for void...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74427&amp;title=app-hangs-in-cxtpsoundmanager#74427</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 10 February 2016 at 5:15am<br /><br />I can see that the code for <font face="Courier New, Courier, mono">void CXTPSoundManager::StopThread()</font> has changed a lot since v15.3.1.<div><br></div><div>I think the problem is related to loader lock of the DLL, meaning that the thread events are somehow locked, during exiting the DLL.</div><div><br></div><div>Looking at the v15.3.1 code it always eventually calls <font face="Courier New, Courier, mono">TerminateThread </font>in the DLLs, most likely since the&nbsp;<font face="Courier New, Courier, mono">GetExitCodeThread </font>does not return the correct exit code.</div><div><br></div><div>CJ probably needs to look at similar constructions for ending threads, and avoiding INFINITE waits.</div><div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Wed, 10 Feb 2016 05:15:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74427&amp;title=app-hangs-in-cxtpsoundmanager#74427</guid>
  </item> 
  <item>
   <title><![CDATA[App Hangs in CXTPSoundManager : I have found that the problem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74426&amp;title=app-hangs-in-cxtpsoundmanager#74426</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 10 February 2016 at 3:28am<br /><br />I have found that the problem lies in the stopping of the sound manager thread from a DLL.<div><br></div><div>It seems that a DLL opened using <font face="Courier New, Courier, mono">LoadLibrary </font>creates a new instance of the&nbsp;<font face="Courier New, Courier, mono">CXTPSoundManager* AFX_CDECL XTPSoundManager()</font> and then calls a new instance of the sound thread in&nbsp;<font face="Courier New, Courier, mono">void CXTPSoundManager::StartThread(</font>).</div><div><br></div><div>So now there is a sound manager for the main application and one for each DLL loaded calling e.g.&nbsp;<font face="Courier New, Courier, mono">CXTPCommandBars::TrackPopupMenu</font>.</div><div><br></div><div>Then it seem that unloading the DLL calls&nbsp;void <font face="Courier New, Courier, mono">CXTPSoundManager::StopThread()</font>, but the <font face="Courier New, Courier, mono">WM_QUIT</font> thread message send to the&nbsp;<font face="Courier New, Courier, mono">SoundThreadProc </font>is never received.</div><div><br></div><div>Any ideas?</div><div>Should I do something about <font face="Courier New, Courier, mono">XTPCommandBars </font>in the <font face="Courier New, Courier, mono">InitInstance </font>of the DLLs.</div><div>Can I call&nbsp;<span style="line-height: 13.44px;"><font face="Courier New, Courier, mono">CXTPSoundManager::StopThread()</font> earlier from the DLLs?</span></div><div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Wed, 10 Feb 2016 03:28:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74426&amp;title=app-hangs-in-cxtpsoundmanager#74426</guid>
  </item> 
  <item>
   <title><![CDATA[App Hangs in CXTPSoundManager : Did you check what the thread...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74425&amp;title=app-hangs-in-cxtpsoundmanager#74425</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2724">SvenC</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 10 February 2016 at 1:42am<br /><br />Did you check what the thread with id m_dwThreadId is doing?]]>
   </description>
   <pubDate>Wed, 10 Feb 2016 01:42:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74425&amp;title=app-hangs-in-cxtpsoundmanager#74425</guid>
  </item> 
  <item>
   <title><![CDATA[App Hangs in CXTPSoundManager : I have seen a problem when closing...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74421&amp;title=app-hangs-in-cxtpsoundmanager#74421</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=686">cpede</a><br /><strong>Subject:</strong> 22888<br /><strong>Posted:</strong> 09 February 2016 at 10:42am<br /><br />I have seen a problem when closing down my application. It sometimes hangs in the&nbsp;<span style="line-height: 13.44px;">WaitForSingleObject in the&nbsp;</span>following code in XTPSystemHelpers:<div><br></div><div><div><font face="Courier New, Courier, mono">void CXTPSoundManager::StopThread()</font></div><div><font face="Courier New, Courier, mono">{</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">	</span>if (NULL != m_hThread)</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">	</span>{</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">		</span>PostThreadMessage(m_dwThreadId, WM_QUIT, 0, 0);</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">		</span>::WaitForSingleObject(m_hThread, INFINITE);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">		</span>::CloseHandle(m_hThread);</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">		</span>m_hThread = 0;</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">		</span>m_dwThreadId = 0;</font></div><div><font face="Courier New, Courier, mono"><span ="Apple-tab-span" style="white-space:pre">	</span>}</font></div><div><font face="Courier New, Courier, mono">}</font></div></div><div><br></div><div>I'm not using sound, but it think that the code is always called by v17.0.0.</div><div>I'm I the only one seeing this problem?</div><div><br></div><div>-cpede</div>]]>
   </description>
   <pubDate>Tue, 09 Feb 2016 10:42:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22888&amp;PID=74421&amp;title=app-hangs-in-cxtpsoundmanager#74421</guid>
  </item> 
 </channel>
</rss>