<?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 hint</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : LoadBitmapFromResource hint]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 18:18:06 +0000</pubDate>
  <lastBuildDate>Sun, 21 Sep 2008 05:05:50 +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=11991</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 hint : Years ago when I designed my system...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=41243&amp;title=loadbitmapfromresource-hint#41243</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=570">nighthawk</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 21 September 2008 at 5:05am<br /><br />Years ago when I designed my system for bringing icons and bitmaps into the CodeJock ImageManager, I ran into several problems when I went directly from the resource file to the ImageManager.&nbsp; Unfortunately, I don't remember exactly what the problems were but the workaround I came up with solved my problem and it may help you as well.&nbsp; It is quite simple, save the icon/bitmap into a temporary file and then use the LoadIcon/LoadBitmap function to bring it into the ImageManager.&nbsp; <br><br>To move the resource item into a temporary file, I use a function called SaveResItemToDisk.&nbsp; Just google it to get all the code and examples of its use.&nbsp; One trick I found works well is to save the resource as a "CUSTOM" type instead of a "BITMAP" or "ICON" type.&nbsp; Once it is in a temp file, it is just data so type is irrelevant.<br>]]>
   </description>
   <pubDate>Sun, 21 Sep 2008 05:05:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=41243&amp;title=loadbitmapfromresource-hint#41243</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : I have a resource dll containing...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=41226&amp;title=loadbitmapfromresource-hint#41226</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2001">PatS</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 19 September 2008 at 11:24am<br /><br />I have a resource dll containing icons, not bitmaps.&nbsp; Is there a known way to load icons from a resource file to be used in my Codejock commandbars?&nbsp; I'd prefer to deal with icons instead of bitmaps.<DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Pat</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 19 Sep 2008 11:24:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=41226&amp;title=loadbitmapfromresource-hint#41226</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint :    PatS wrote:Does the LoadBitmapFromResource...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40975&amp;title=loadbitmapfromresource-hint#40975</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4463">MadRiver</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 12 September 2008 at 1:09pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by PatS" alt="Originally posted by PatS" style="vertical-align: text-bottom;" /> <strong>PatS wrote:</strong><br /><br /><font size="2" face="Arial, Helvetica, sans-serif">Does the LoadBitmapFromResource method work with icons?&nbsp; I can't get this method to work either.</font></td></tr></table><br>I believe icons are NOT supported.&nbsp; I have a dll with a bitmap and an icon; the bitmap loads, the icon does not.<br><br>]]>
   </description>
   <pubDate>Fri, 12 Sep 2008 13:09:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40975&amp;title=loadbitmapfromresource-hint#40975</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint :  I am having trouble using this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40948&amp;title=loadbitmapfromresource-hint#40948</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4463">MadRiver</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 11 September 2008 at 4:43pm<br /><br />I am having trouble using this with C++ (not MFC).<br><br>My dll has one resouce, a 32 x 32 icon.<br>&nbsp;&nbsp;&nbsp; HRESULT hr;<br>&nbsp;&nbsp;&nbsp; HMODULE hMod = 0;<br><br>&nbsp;&nbsp;&nbsp; int cmds&#091;1&#093;;<br>&nbsp;&nbsp;&nbsp; cmds&#091;0&#093; = M_FILE_CLOSE;<br>&nbsp;&nbsp;&nbsp; CComSafeArray&lt;int&gt; safeCommands(_countof(cmds));<br>&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; _countof(cmds); ++i) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; safeCommands.SetAt(i, cmds<em>);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;<i>&nbsp; hMod = LoadLibrary(pszNameDLL);<br>&nbsp;&nbsp;&nbsp; hr = pIcons-&gt;LoadBitmapFromResource((long) hMod, 105, CComVariant((LPSAFEARRAY)safeCommands), xtpImageNormal); <br>&nbsp;&nbsp;&nbsp; ATLASSERT(SUCCEEDED(hr));<br><br>I suspect that the problem may be due somehow to having to cast the hMod to long.&nbsp; Unfortunately, hr == S_OK.<br>When I open the dll in VisStudio, the one resource has the ID 105.<br><br>When I create a button control, I call<br>&nbsp;&nbsp;&nbsp; pControl-&gt;PutIconID(M_FILE_CLOSE);<br><br>No icon appears on the button.<br><br>What am I doing wrong?<br><br>UPDATE:&nbsp; It appears icons are not supported, only bitmaps.<br><br><br></i></em>]]>
   </description>
   <pubDate>Thu, 11 Sep 2008 16:43:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40948&amp;title=loadbitmapfromresource-hint#40948</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : Hi Waleed,  That gives me a...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40810&amp;title=loadbitmapfromresource-hint#40810</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4223">AndyWilton</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 08 September 2008 at 1:17pm<br /><br />Hi Waleed,<DIV>&nbsp;</DIV><DIV>That gives me a couple of ideas?&nbsp; I shall try it out.</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>&nbsp;</DIV><DIV>Andy</DIV>]]>
   </description>
   <pubDate>Mon, 08 Sep 2008 13:17:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40810&amp;title=loadbitmapfromresource-hint#40810</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : Hi Andy,  If clarion is capable...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40702&amp;title=loadbitmapfromresource-hint#40702</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2890">WaleedSeada</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 04 September 2008 at 6:51am<br /><br />Hi Andy, <DIV>If clarion is capable of dealing with .dll's I guess you can create the .dll using other tool as I suggest to you (Restorator2007).... It is possible to assign ID to img's this way ...</DIV><DIV>&nbsp;</DIV><DIV>Then you can referance the Img using the API ...</DIV><DIV>&nbsp;</DIV><DIV>Right ?!</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 04 Sep 2008 06:51:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40702&amp;title=loadbitmapfromresource-hint#40702</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : Hi Waleed,    Many thanks for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40699&amp;title=loadbitmapfromresource-hint#40699</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4223">AndyWilton</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 04 September 2008 at 5:53am<br /><br />Hi Waleed, <DIV></DIV><DIV>&nbsp;</DIV><DIV>Many thanks for your example code.</DIV><DIV>&nbsp;</DIV><DIV>However, the language I develop in is called Clarion and its interface to compiling in Resource images is quite a bit different.&nbsp;&nbsp;One problem I have is that I can't control the ID of any of the compiled in Resources.</DIV><DIV>&nbsp;</DIV><DIV>To combat this, I use an API to obtain a handle to the Compiled in Image Resource, but when I use this as a parameter it doesn't work.</DIV><DIV>&nbsp;</DIV><DIV>Does anybody have any examples of getting the "LoadBitmapFromResource" to work from such a handle?</DIV><DIV>&nbsp;</DIV><DIV>One thing to note is that each image file will only ever contain 1 image.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance,</DIV><DIV>&nbsp;</DIV><DIV>Andy</DIV>]]>
   </description>
   <pubDate>Thu, 04 Sep 2008 05:53:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40699&amp;title=loadbitmapfromresource-hint#40699</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : Hello Andy,  First of all you...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40694&amp;title=loadbitmapfromresource-hint#40694</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2890">WaleedSeada</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 04 September 2008 at 3:05am<br /><br />Hello Andy,<DIV>&nbsp;</DIV><DIV>First of all you should create a single image that represent your imgs that you will use for the commandbar....</DIV><DIV>&nbsp;</DIV><DIV><img src="https://forum.codejock.com/uploads/20080904_022506_LargeIc&#111;ns.png" border="0"></DIV><DIV>&nbsp;</DIV><DIV>This image is a collection of 13 image of each 32x32 pixel that makes a 416x32 pixel of the main image.</DIV><DIV>&nbsp;</DIV><DIV>You then add this image to your resource file using resource editor&nbsp;like (Restorator2007) and give that resource (img) an ID = 1000.</DIV><DIV>&nbsp;</DIV><DIV>You should use&nbsp;a function (or API) to load the .Dll that contains the resource (.bmp,.png,. ...etc) this function should return a handle to the .dll</DIV><DIV>example:&nbsp;<EM>dllhandle</EM> = LoadLibraryA("Resource.dll")</DIV><DIV>&nbsp;</DIV><DIV>Define an array of integers with relative ID of your buttons that will use the images example:</DIV><DIV>ImageList = {101,102,103,104,105}</DIV><DIV>&nbsp;</DIV><DIV>and remember that the image should have the same count as the items in the array as we have here 13 image in our main img with 32x32 each, your array should have 13 Button ID's.</DIV><DIV>&nbsp;</DIV><DIV>Call the iconmanager.Loadbitmap(... passing that handle and the imageID to LoadBitmapfromResource to get back the array of the images that will be created look at this :</DIV><DIV>IconMgr.Icons.LoadBitmapFromResource(<EM>dllhandle</EM>, <EM>ImageID</EM>, <EM>ImageList</EM>, xtpImageNormal)</DIV><DIV>&nbsp;</DIV><DIV>I hope this can help...</DIV><DIV>&nbsp;</DIV><DIV>Best regards</DIV>]]>
   </description>
   <pubDate>Thu, 04 Sep 2008 03:05:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40694&amp;title=loadbitmapfromresource-hint#40694</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : Does the LoadBitmapFromResource...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40661&amp;title=loadbitmapfromresource-hint#40661</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2001">PatS</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 02 September 2008 at 12:37pm<br /><br /><FONT face="Arial, Helvetica, sans-serif" size=2>Does the LoadBitmapFromResource method work with icons?&nbsp; I can't get this method to work either.</FONT>]]>
   </description>
   <pubDate>Tue, 02 Sep 2008 12:37:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40661&amp;title=loadbitmapfromresource-hint#40661</guid>
  </item> 
  <item>
   <title><![CDATA[LoadBitmapFromResource hint : Hi,  I&amp;#039;m sorry but I still...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40554&amp;title=loadbitmapfromresource-hint#40554</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4223">AndyWilton</a><br /><strong>Subject:</strong> 11991<br /><strong>Posted:</strong> 28 August 2008 at 9:37am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>I'm sorry but I still don't get it.&nbsp; Basically, I'm compiling a single PNG file into my app.</DIV><DIV>&nbsp;</DIV><DIV>I can get the handle of the EXE/DLL that the image is compliled into, and I can get handle of the Image within the EXE/DLL but I don't understand where I would specify the handle to the image within the command?</DIV><DIV>&nbsp;</DIV><DIV>A more detailed explanation would be greatfully received.</DIV><DIV>&nbsp;</DIV><DIV>Many thanks in advance,</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>&nbsp;</DIV><DIV>Andy</DIV>]]>
   </description>
   <pubDate>Thu, 28 Aug 2008 09:37:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11991&amp;PID=40554&amp;title=loadbitmapfromresource-hint#40554</guid>
  </item> 
 </channel>
</rss>