<?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 : HashKey() in XTPMacros.h causes problems</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : HashKey() in XTPMacros.h causes problems]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 09 Apr 2026 14:02:13 +0000</pubDate>
  <lastBuildDate>Thu, 02 May 2013 00:00:41 +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=21619</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[HashKey() in XTPMacros.h causes problems : HashKey() inXTPMacros.hmayoverrideMFC&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=21619&amp;PID=70893&amp;title=hashkey-in-xtpmacros-h-causes-problems#70893</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7885">scotia</a><br /><strong>Subject:</strong> 21619<br /><strong>Posted:</strong> 02 May 2013 at 12:00am<br /><br />HashKey() in&nbsp;XTPMacros.h&nbsp;may&nbsp;override&nbsp;MFC's HashKey() but it generates hash value in a different way from MFC. That means you cannot pass a CMap created in a DLL linked with ToolKitPro to the other DLL not linked with&nbsp;ToolKitPro. I don't know why we need&nbsp;the&nbsp;HashKey() in XTPMacros.h while there is one in MFC.&nbsp;Please remove the&nbsp;HashKey() in XTPMacros.h.<div><br></div><div>In&nbsp;<span style="line-height: 1.4;">XTPMacros.h:</span></div><div><div>template&lt;&gt; AFX_INLINE UINT AFXAPI HashKey&lt;UINT_PTR&gt;(UINT_PTR key) {</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>return (DWORD)(((DWORD_PTR)key)&gt;&gt;4);</div><div>}</div><div><br></div><div>In MFC:</div><div>AFX_INLINE UINT AFXAPI HashKey(ARG_KEY key)</div><div>{</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>// (algorithm copied from STL hash in xfunctional)</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>ldiv_t HashVal = ldiv((long)(ARG_KEY)key, 127773);</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>HashVal.rem = 16807 * HashVal.rem - 2836 * HashVal.quot;</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>if (HashVal.rem &lt; 0)</div><div><span ="Apple-tab-span" style="white-space:pre">		</span>HashVal.rem += 2147483647;</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>return ((UINT)HashVal.rem);</div><div>}</div></div><div><br></div>]]>
   </description>
   <pubDate>Thu, 02 May 2013 00:00:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=21619&amp;PID=70893&amp;title=hashkey-in-xtpmacros-h-causes-problems#70893</guid>
  </item> 
 </channel>
</rss>