<?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 : Loading Icons From a Resource File</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Loading Icons From a Resource File]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 16:00:35 +0000</pubDate>
  <lastBuildDate>Fri, 22 Feb 2013 02:38:21 +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=20178</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[Loading Icons From a Resource File : How does it work in C#.NET?Public...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20178&amp;PID=69744&amp;title=loading-icons-from-a-resource-file#69744</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4998">iamgtd</a><br /><strong>Subject:</strong> 20178<br /><strong>Posted:</strong> 22 February 2013 at 2:38am<br /><br />How does it work in C#.NET?<br><br><pre ="syntax" lang="VB"><strong>Public Sub LoadIconFromResource</strong>( _   <strong>ByVal </strong><i><a href="#" target="_blank">Module</a></i> <strong>As</strong> <b>Long</b>, _   <strong>ByVal </strong><i><a href="#" target="_blank">Resource</a></i> <strong>As</strong> <b>Long</b>, _   <strong>ByVal </strong><i><a href="#" target="_blank">Command</a></i> <strong>As</strong> <b>Long</b>, _   <strong>ByVal </strong><i><a href="#" target="_blank">imageState</a></i> <strong>As</strong> <a href="XtremeCalendarC&#111;ntrol~Enumerati&#111;ns~XTPImageState_EN.html" target="_blank">XTPImageState</a> _)<strong> </strong></pre>Is there another way to get the value for Module as the API-Function&nbsp; LoadLibraryEx?<br>In C# the images in the resources have names (string) and not&nbsp; long-values, how do I convert this values?<br><br>thanks in advance<br>]]>
   </description>
   <pubDate>Fri, 22 Feb 2013 02:38:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20178&amp;PID=69744&amp;title=loading-icons-from-a-resource-file#69744</guid>
  </item> 
  <item>
   <title><![CDATA[Loading Icons From a Resource File :  Could be a number of things...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20178&amp;PID=69020&amp;title=loading-icons-from-a-resource-file#69020</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 20178<br /><strong>Posted:</strong> 03 October 2012 at 9:47am<br /><br />Could be a number of things without seeing your complete code or how you made the RES.<div><br></div><div>First in the VB IDE (see add-in manager if not visible) open VB Resource Editor, verify your PNG images have the "PNG" type. &nbsp;If you were to add a new PNG you would click Add Custom Resource and in Resource type write "PNG" after you have selected the image.</div><div><br></div><div>Second,&nbsp;app.hinstance just r<span style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px; line-height: normal; ">eturns a handle to the instance of the application. &nbsp;You need to use&nbsp;</span><font face="Segoe UI, Verdana, Arial" size="2"><span style="line-height: normal;">LoadLibraryEx.</span></font></div><div><font face="Segoe UI, Verdana, Arial" size="2"><span style="line-height: normal;"><br></span></font></div><div><font face="Segoe UI, Verdana, Arial" size="2"><span style="line-height: normal;">Here is a working sample assuming your RES file is set up correctly like I mentioned above.</span></font></div><div><font face="Segoe UI, Verdana, Arial" size="2"><span style="line-height: normal;"><br></span></font></div><div><font face="Segoe UI, Verdana, Arial" size="2"><span style="line-height: normal;"><table width="99%"><tr><td><pre class="BBcode"></span></font></div><div><font face="Segoe UI, Verdana, Arial" size="2"><div><span style="line-height: normal;">Option Explicit</span></div><div><span style="line-height: normal;"><br></span></div><div><span style="line-height: normal;">Private Declare Function LoadLibraryEx _</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Lib "kernel32" _</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Alias "LoadLibraryExA" (ByVal lpLibFileName As String, _</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ByVal hFile As Long, _</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ByVal dwFlags As Long) As Long</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">Private Declare Function FreeLibrary _</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Lib "kernel32" (ByVal hLibModule As Long) As Long</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">Private m_hMod As Long</span></div><div><span style="line-height: normal;"><br></span></div><div><span style="line-height: normal;">Const ID_TEST_NEW = 111</span></div><div><span style="line-height: normal;">Const ID_TEST_ECLUB = 112</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">Private Sub LoadResources()</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; Dim IDS() As Long</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; ReDim IDS(1)</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; IDS(0) = ID_TEST_NEW</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; IDS(1) = ID_TEST_ECLUB</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; If (m_hMod &lt;&gt; 0) Then</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; FreeLibrary m_hMod</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; End If</span></div><div><span style="line-height: normal;"><br></span></div><div><span style="line-height: normal;">&nbsp; &nbsp; m_hMod = 0</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; m_hMod = LoadLibraryEx(App.Path + "\Project1.exe", 0, 0)</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; ImageManager.Icons.LoadBitmapFromResource LoadLibraryEx(App.Path + "\Project1.exe", 0, 0), ID_TEST_NEW, IDS(0), xtpImageNormal</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; ImageManager.Icons.LoadBitmapFromResource LoadLibraryEx(App.Path + "\Project1.exe", 0, 0), ID_TEST_ECLUB, IDS(1), xtpImageNormal</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; If (m_hMod &lt;&gt; 0) Then</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; FreeLibrary m_hMod</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; End If</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">End Sub</span></div><div><span style="line-height: normal;"><br></span></div><div><span style="line-height: normal;"><br></span></div><div><span style="line-height: normal;">Private Sub Form_Load()</span></div><div><span style="line-height: normal;"><br></span></div><div><span style="line-height: normal;">&nbsp; &nbsp; CommandBarsGlobalSettings.App = App</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; CommandBars.DeleteAll</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; Dim Toolbar As CommandBar</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; Set Toolbar = CommandBars.Add("mainapp", xtpBarTop)</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; With Toolbar.Controls</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp; .Add xtpControlButton, ID_TEST_NEW, "&amp;Test"</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; End With</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; &nbsp; &nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; LoadResources</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">&nbsp; &nbsp; Set CommandBars.Icons = ImageManager.Icons</span></div><div><span style="line-height: normal;">&nbsp; &nbsp;&nbsp;</span></div><div><span style="line-height: normal;">End Sub</span></div><div style="line-height: normal; "><br></div></font></div><div><font face="Segoe UI, Verdana, Arial" size="2"><span style="line-height: normal;"></pre></td></tr></table></span></font></div>]]>
   </description>
   <pubDate>Wed, 03 Oct 2012 09:47:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20178&amp;PID=69020&amp;title=loading-icons-from-a-resource-file#69020</guid>
  </item> 
  <item>
   <title><![CDATA[Loading Icons From a Resource File : Hi  I am using Xtreme Command...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20178&amp;PID=68995&amp;title=loading-icons-from-a-resource-file#68995</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7600">mzwandile</a><br /><strong>Subject:</strong> 20178<br /><strong>Posted:</strong> 28 September 2012 at 10:12am<br /><br />Hi<DIV>&nbsp;</DIV><DIV>I am using Xtreme Command Bars ActiveX v15.2.1 and need assistance with loading icons from a resource file (VB6 .RES file). I've got a PNG image with ID: "Exit16_PNG" in the resource file (filename.RES) and I'm doing the following in my VB6 Code to load the image:</DIV><DIV>&nbsp;</DIV><DIV><strong><FONT color=#00cc00>CommandBars.Icons.LoadBitmapFromResource App.hInstance, "Exit16_PNG", ID_FILE_EXIT, xtpImageNormal</FONT></strong></DIV><DIV><strong><FONT color=#00cc00></FONT></strong>&nbsp;</DIV><DIV><FONT color=#000000>This does not load the icon though! <img src="http://forum.codejock.com/smileys/smiley5.gif" height="17" width="17" border="0" alt="C&#111;nfused" title="C&#111;nfused" />&nbsp;Am I missing something?</FONT></DIV><DIV>&nbsp;</DIV><DIV>Any assistance will be much appreciated.</DIV>]]>
   </description>
   <pubDate>Fri, 28 Sep 2012 10:12:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20178&amp;PID=68995&amp;title=loading-icons-from-a-resource-file#68995</guid>
  </item> 
 </channel>
</rss>