<?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 finds wrong resource</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : LoadBitmapFromResource finds wrong resource]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 20 Apr 2026 17:58:45 +0000</pubDate>
  <lastBuildDate>Wed, 11 Jan 2012 17:30:00 +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=19399</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 finds wrong resource : When I add PNG and BMP resources...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19399&amp;PID=67392&amp;title=loadbitmapfromresource-finds-wrong-resource#67392</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 19399<br /><strong>Posted:</strong> 11 January 2012 at 5:30pm<br /><br />When I add PNG and BMP resources to my project the IDE separates the two types of images in the resource view. I have a "Bitmap" and a "PNG" entry. So far so good.<DIV>&nbsp;</DIV><DIV>But the IDE can assign the same resource ID to a BMP and a PNG resource. When I call CXTPImageManager::SetIcons, LoadBitmapFromResource is called. There I see this:</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>hModule = AfxFindResourceHandle(lpszResource, _T(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"PNG"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>));</P><DIV>When I am debugging, I see that even if I pass in an ID that is used only on a BMP resource, the call succeeds. Hence, when I am trying to load a BMP resource for which a PNG resource has been assigned the same ID, the image manager will load the PNG and not the BMP and that can cause problems since the wrong image has been loaded.</DIV><DIV>&nbsp;</DIV><DIV>My only work-around appears to be to manually edit the values in resource.h. Is there a better way?</DIV></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 11 Jan 2012 17:30:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19399&amp;PID=67392&amp;title=loadbitmapfromresource-finds-wrong-resource#67392</guid>
  </item> 
 </channel>
</rss>