<?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 : LoadBitmapFromResource on x64</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : LoadBitmapFromResource on x64]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 17:30:24 +0000</pubDate>
  <lastBuildDate>Wed, 27 Feb 2013 16:22:27 +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=20641</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[LoadBitmapFromResource on x64 : I am porting some code to run...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20641&amp;PID=69768&amp;title=loadbitmapfromresource-on-x64#69768</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7887">bob.fortin</a><br /><strong>Subject:</strong> 20641<br /><strong>Posted:</strong> 27 February 2013 at 4:22pm<br /><br />I am porting some code to run under a 64 bit windows exe.<br /><br />IImageManagerIconsPtr pActiveIcons = GetActiveIconsPtr();<br /><br />if (pActiveIcons) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HRESULT hr = pActiveIcons-&gt;LoadBitmapFromResource((long)lResourceInst, lSmallResId, CComVariant((LPSAFEARRAY)safeCommands), xtpImageNormal);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ATLASSERT(SUCCEEDED(hr));<br /><br />This works on 32bit codejock, but not on x64.<br />I have an hintance of a resource, which is a long on win32, but a 64bit value on x64. I am confused why the LoadBitmapFromResource method only takes a long as a parameter - forcing me to cast the 64bit pointer to 32bits, and making it not valid so that the call does not work.<br /><br />The lResourceInst is 0x0000000180000000 which gets casted to 0x0000000080000000. The when I call LoadBitmapFromResource it returns success but the bitmap does not draw later and this shows in the debug window:<br /><br />First-chance exception at 0x000007fb9808fbf7 in mapinfow.exe: 0xC0000005: Access violation reading location 0x0000000080000000.<br /><br />Is there a way to call the com method with a 64bit instance handle? I am using wrappers generated by visual studio compilation.]]>
   </description>
   <pubDate>Wed, 27 Feb 2013 16:22:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20641&amp;PID=69768&amp;title=loadbitmapfromresource-on-x64#69768</guid>
  </item> 
 </channel>
</rss>