<?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 : [Solved]  CXTPMarkupListBox crashes on empty list</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : [Solved]  CXTPMarkupListBox crashes on empty list]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 21:03:38 +0000</pubDate>
  <lastBuildDate>Mon, 03 Feb 2020 14:44:40 +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=23947</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[[Solved]  CXTPMarkupListBox crashes on empty list :   Fredrik wrote:Just looked at...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23947&amp;PID=77610&amp;title=solved-cxtpmarkuplistbox-crashes-on-empty-list#77610</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4319">sdancer75</a><br /><strong>Subject:</strong> 23947<br /><strong>Posted:</strong> 03 February 2020 at 2:44pm<br /><br /> <table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by Fredrik" alt="Originally posted by Fredrik" style="vertical-align: text-bottom;" /> <strong>Fredrik wrote:</strong><br /><br />Just looked at the code in version 18.x and 19 it's fixed there.</td></tr></table> <br /><br />Thanks]]>
   </description>
   <pubDate>Mon, 03 Feb 2020 14:44:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23947&amp;PID=77610&amp;title=solved-cxtpmarkuplistbox-crashes-on-empty-list#77610</guid>
  </item> 
  <item>
   <title><![CDATA[[Solved]  CXTPMarkupListBox crashes on empty list : Just looked at the code in version...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23947&amp;PID=77609&amp;title=solved-cxtpmarkuplistbox-crashes-on-empty-list#77609</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1263">Fredrik</a><br /><strong>Subject:</strong> 23947<br /><strong>Posted:</strong> 03 February 2020 at 12:23pm<br /><br />Just looked at the code in version 18.x and 19 it's fixed there.]]>
   </description>
   <pubDate>Mon, 03 Feb 2020 12:23:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23947&amp;PID=77609&amp;title=solved-cxtpmarkuplistbox-crashes-on-empty-list#77609</guid>
  </item> 
  <item>
   <title><![CDATA[[Solved]  CXTPMarkupListBox crashes on empty list : Version : 15.x 16.x and maybe...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23947&amp;PID=77590&amp;title=solved-cxtpmarkuplistbox-crashes-on-empty-list#77590</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4319">sdancer75</a><br /><strong>Subject:</strong> 23947<br /><strong>Posted:</strong> 28 January 2020 at 3:49am<br /><br /><div><font size="3"><font color="#ff0000" style="font-weight: bold;">Version </font>: 15.x 16.x and maybe newer versions</font></div><div><font size="3"><font color="#ff0000"><b><br></b></font></font></div><div><font size="3"><font color="#ff0000"><b>Symptoms </b></font>: <font face="Courier New, Courier, mono">CXTPMarkupListBox</font> and <font face="Courier New, Courier, mono">CXTPListBox</font> crashes when the list box is empty and move mouse inside its client area.</font></div><div><font size="3"><br></font></div><div><font size="3"><font color="#ff0000"><b>Problem </b></font>:&nbsp;</font></div><div><span style="font-size: medium;"><font face="Arial, Helvetica, sans-serif">Inside&nbsp;&nbsp;</font></span><font size="3"><font face="Courier New, Courier, mono">void CXTPListBox::OnMouseMove(UINT nFlags, CPoint point)</font></font></div><div><font size="3">the MFC function <font face="Courier New, Courier, mono">ItemFromPoint()&nbsp;</font></font><span style="font-family: Arial, Helvetica, sans-serif; font-size: medium;">returns a WORD (not signed) value of 65535 </span><font size="3"><font face="Arial, Helvetica, sans-serif">which means invalid or empty list.</font><span style="font-family: Arial, Helvetica, sans-serif;"> This value is returned to </span><font face="Courier New, Courier, mono">nHotItem</font><span style="font-family: Arial, Helvetica, sans-serif;">.</span></font></div><div><font size="3"><br></font></div><div><font size="3" face="Courier New, Courier, mono">int nHotItem = ItemFromPoint(point, bOutside)&nbsp;</font></div><div><font face="Arial, Helvetica, sans-serif" size="3"><br></font></div><div><font face="Arial, Helvetica, sans-serif" size="3">The signed </font><font size="3" face="Courier New, Courier, mono">int nHotItem</font><font face="Arial, Helvetica, sans-serif" size="3"> is now <b>4 bytes</b> so instead of converting the non signed word <i>65535 </i>to <i>-1</i>, it remains <i>65535. </i>After this,<i>&nbsp;</i>the code is calling&nbsp;</font></div><div><font size="3" face="Courier New, Courier, mono"><br></font></div><div><font size="3" face="Courier New, Courier, mono">BOOL CXTPMarkupListBox::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)&nbsp;</font></div><div><font face="Arial, Helvetica, sans-serif" size="3"><br></font></div><div><font face="Arial, Helvetica, sans-serif" size="3">which in turn is calling an invalid item in&nbsp; code below.</font></div><div><font face="Arial, Helvetica, sans-serif" size="3"><br></font></div><div><font size="3" face="Courier New, Courier, mono">XTP_MARKUP_LISTITEM *pItem = reinterpret_cast&lt;XTP_MARKUP_LISTITEM*&gt;(GetItemDataPtr(m_nHotItem));</font></div><div><font size="3"><br></font></div><div><font size="3">At this point the code crashes.</font></div><div><div><font color="#ff0000" size="3"><b><br></b></font></div><div><font color="#ff0000" size="3"><b>Solution</b></font></div></div><div><br></div><div><font size="3">Inside&nbsp;</font><span style="font-family: &quot;Courier New&quot;, Courier, mono; font-size: medium;">void CXTPListBox::OnMouseMove(UINT nFlags, CPoint point)</span></div><div><br></div><div><font size="3">declare <i>nHotItem </i>as <i>short int</i> instead of an <i>int </i>like below.</font>&nbsp;</div><div><br></div><div><span style="font-family: &quot;Courier New&quot;, Courier, mono; font-size: medium;"><i><font color="#0000ff">short </font></i>int nHotItem = ItemFromPoint(point, bOutside)&nbsp;</span></div><div><span style="font-family: &quot;Courier New&quot;, Courier, mono; font-size: medium;"><br></span></div><div><span style="font-size: medium;"><font face="Arial, Helvetica, sans-serif">Recompile all codejock libs and rebuild your project.</font></span></div>]]>
   </description>
   <pubDate>Tue, 28 Jan 2020 03:49:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23947&amp;PID=77590&amp;title=solved-cxtpmarkuplistbox-crashes-on-empty-list#77590</guid>
  </item> 
 </channel>
</rss>