<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Icon aus externer DLL Laden?]]></title><description><![CDATA[<p>Hi.<br />
Da ich es nicht hinbekomme ein Bild anzuzeigen wollte ich mal fragen, ob es an meinem Code zum darstellen liegt - oder am code zum laden.<br />
Das meiste ist noch 'vorbereitungscode' dafuer, wie es mal arbeiten soll (das sprintf) und die ID 123 gibt es auf jeden Fall in der DLL. Das Problem ist, dass der Compiler nicht meckert und das Programm ebensowenig was von sich gibt, wenn die datei 'res.dll' nicht existiert...</p>
<p>Code zum Laden:</p>
<pre><code>HINSTANCE hClientResources = AfxGetResourceHandle();
	AfxSetResourceHandle(::GetModuleHandle(&quot;res.dll&quot;));
	AfxSetResourceHandle(hClientResources);

	char tmp[50] = &quot;&quot;;
	sprintf(tmp,&quot;%s%s&quot;,&quot;ICONRES_&quot;,&quot;DUMMY&quot;);

	HICON hIcon = LoadIcon(hClientResources,  MAKEINTRESOURCE(123));
</code></pre>
<p>Code zum darstellen:</p>
<pre><code>m_TestButton.ModifyStyle( 0, BS_ICON );
	m_TestButton.SetIcon(hIcon);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/182590/icon-aus-externer-dll-laden</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 10:28:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/182590.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 May 2007 00:43:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 00:43:36 GMT]]></title><description><![CDATA[<p>Hi.<br />
Da ich es nicht hinbekomme ein Bild anzuzeigen wollte ich mal fragen, ob es an meinem Code zum darstellen liegt - oder am code zum laden.<br />
Das meiste ist noch 'vorbereitungscode' dafuer, wie es mal arbeiten soll (das sprintf) und die ID 123 gibt es auf jeden Fall in der DLL. Das Problem ist, dass der Compiler nicht meckert und das Programm ebensowenig was von sich gibt, wenn die datei 'res.dll' nicht existiert...</p>
<p>Code zum Laden:</p>
<pre><code>HINSTANCE hClientResources = AfxGetResourceHandle();
	AfxSetResourceHandle(::GetModuleHandle(&quot;res.dll&quot;));
	AfxSetResourceHandle(hClientResources);

	char tmp[50] = &quot;&quot;;
	sprintf(tmp,&quot;%s%s&quot;,&quot;ICONRES_&quot;,&quot;DUMMY&quot;);

	HICON hIcon = LoadIcon(hClientResources,  MAKEINTRESOURCE(123));
</code></pre>
<p>Code zum darstellen:</p>
<pre><code>m_TestButton.ModifyStyle( 0, BS_ICON );
	m_TestButton.SetIcon(hIcon);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1292929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1292929</guid><dc:creator><![CDATA[Nachtwind]]></dc:creator><pubDate>Sun, 27 May 2007 00:43:36 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 04:17:30 GMT]]></title><description><![CDATA[<p>Äh. Du musst schon res.dll erstmal laden.<br />
Und wenn du LoadIcon so verwendest brauchst du AfxSetResourceHandle garnicht, ganz abgesehen davon dass es so wie du es verwendest keinen Sinn macht.</p>
<p>Guck dir LoadLibrary an. GetModuleHandle funktioniert nur mit DLLs die bereits geladen sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1292938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1292938</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 27 May 2007 04:17:30 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 09:49:16 GMT]]></title><description><![CDATA[<p>OK danke - das hat schonmal prima weitergeholfen :0)</p>
<pre><code>HINSTANCE hDll = NULL;
    hDll = LoadLibrary(TEXT(&quot;res.dll&quot;));

    if (!hDll)
		WriteConsoleString(&quot;DLL Nicht geladen&quot;); 

	WriteConsoleString(&quot;DLL geladen&quot;);
    HICON hIcon;

	char tmp[20] = &quot;ICONRES_DUMMY&quot;;
	hIcon = LoadIcon(hDll, MAKEINTRESOURCE(&quot;123&quot;));

	m_Rconf.ModifyStyle( 0, BS_ICON );
    m_Rconf.SetIcon(hIcon); 

    FreeLibrary(hDll);
</code></pre>
<p>Funktioniert wunderbar :0)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1292984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1292984</guid><dc:creator><![CDATA[Nachtwind]]></dc:creator><pubDate>Sun, 27 May 2007 09:49:16 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 10:07:17 GMT]]></title><description><![CDATA[<p>Hey,</p>
<p>kann man dieses Icon dann auch irgendwie als Standardicon für die Anwendung setzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1292998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1292998</guid><dc:creator><![CDATA[BlueBalloon]]></dc:creator><pubDate>Sun, 27 May 2007 10:07:17 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 10:42:27 GMT]]></title><description><![CDATA[<p>Sorry, keine Ahnung ob oder wie das geht :0/</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293017</guid><dc:creator><![CDATA[Nachtwind]]></dc:creator><pubDate>Sun, 27 May 2007 10:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 15:57:59 GMT]]></title><description><![CDATA[<p>Wenn Du nur das Icon willst: ExtractIcon(Ex)</p>
<p>Was verstehst Du unter &quot;Standard-Icon&quot;? Das was im Explorer angezeigt wird? Oder das, was im Fenster oben links erscheint.<br />
Das wa sim Explorer angezeigt wird ist das erste Icon in der EXE. Somit kannst Du kein Externen Icon hier verwenden (das geht nur bei &quot;Verknüpfungen&quot;).</p>
<p>Ansonsten &quot;WM_SETICON&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293175</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293175</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 27 May 2007 15:57:59 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 16:28:41 GMT]]></title><description><![CDATA[<p>Hallo Jochen,</p>
<p>ich meinte das Programmicon das ich im EXplorer sehe, genau!<br />
Gut, da gibt es also keine Chance, sehe ich auch ein.<br />
Aber ist es nicht genau das gleiche Icon, welches ich standardmäßig<br />
in meiner Anwendung oben links in der Ecke anzeige?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293193</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293193</guid><dc:creator><![CDATA[BlueBalloon]]></dc:creator><pubDate>Sun, 27 May 2007 16:28:41 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Sun, 27 May 2007 18:31:17 GMT]]></title><description><![CDATA[<p>Das Icon welches im explorer angezeigt wird kann man natürlich nicht mit dem Programm verändern, da es ja nicht läuft - der Explorer macht bloss das File auf und nimmt sich da das erste Icon raus.</p>
<p>Und das Icon welches im Fenster links oben angezeigt wird muss nicht unbedingt das erste im File sein, das wird ja bei RegisterClass mit angegeben, kann also auch das 100. Icon im File sein oder von ganz woanders her stammen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293291</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 27 May 2007 18:31:17 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Mon, 28 May 2007 08:45:22 GMT]]></title><description><![CDATA[<p>Oder man definiert es selbst mit WM_SETICON!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293503</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 28 May 2007 08:45:22 GMT</pubDate></item><item><title><![CDATA[Reply to Icon aus externer DLL Laden? on Mon, 28 May 2007 12:25:01 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Oder man definiert es selbst mit WM_SETICON!</p>
</blockquote>
<p>Sag ich doch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293715</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293715</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 28 May 2007 12:25:01 GMT</pubDate></item></channel></rss>