<?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[Problem mit einbenden der DLL]]></title><description><![CDATA[<p>Guten Tag zusammen!</p>
<p>Ich habe ein Problem beim Nutzen einer DLL. Ich mache das zum ersten mal und finde leider meinen Fehler nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title="=("
      alt="😞"
    /><br />
Das Progg soll einen Screenshot erstellen und unter C:\neu.bmp speichern. Bis hierhin funktionier auch noch alles. Allerdings wird danach eine DLL aufgerufen, und diese soll das BMP-Bild in eine JPG-Bild umwandeln. Tut sie aber leider nicht.<br />
Die DLL ist die Bildconvertierungs DLL von <a href="http://www.Cool-Monkey.de" rel="nofollow">www.Cool-Monkey.de</a>.<br />
Hat evtl jemand eine Idee wo mein Fehler liegt?<br />
Oder eine Alternative, wie ich mein Bild in JPG umgewandelt bekomme (evtl jemand nen fertigen Code?)?<br />
Vielen Dank schonmal!</p>
<pre><code>void Hook(bool State)
{
	if(State == true){
		hDLL = LoadLibrary(&quot;convert2.dll&quot;);
		if(hDLL == NULL){
			MessageBox(NULL, &quot;Fehler beim Laden der DLL&quot;, &quot;Fehler&quot;, MB_OK);
		}
		Convert = (CONVERTER) GetProcAddress(hDLL,&quot;Convert&quot;);
		if(Convert == NULL){
			MessageBox(NULL, &quot;Fehler: Convert nicht gefunden in DLL.&quot;, &quot;Fehler&quot;, MB_OK);
		}
	}else{
		FreeLibrary(hDLL);
	}
}
int WINAPI WinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
{

	std::string path = &quot;C:\\neu.bmp&quot;;
	std::string format = &quot;JPG&quot;;
	std::string pathn = &quot;C:\\neu.jpg&quot;;
	LONG quali = 1;
	LONG bh = 0;

	SaveScreen(path); // erstellt einen Screenshot und speichert ihn unter path
	Hook(true);
	Sleep(1000);
	Convert(path,format,quali,bh,bh,pathn);
	Hook(false);

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/263075/problem-mit-einbenden-der-dll</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 17:03:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/263075.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Mar 2010 15:57:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Mon, 15 Mar 2010 15:57:55 GMT]]></title><description><![CDATA[<p>Guten Tag zusammen!</p>
<p>Ich habe ein Problem beim Nutzen einer DLL. Ich mache das zum ersten mal und finde leider meinen Fehler nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title="=("
      alt="😞"
    /><br />
Das Progg soll einen Screenshot erstellen und unter C:\neu.bmp speichern. Bis hierhin funktionier auch noch alles. Allerdings wird danach eine DLL aufgerufen, und diese soll das BMP-Bild in eine JPG-Bild umwandeln. Tut sie aber leider nicht.<br />
Die DLL ist die Bildconvertierungs DLL von <a href="http://www.Cool-Monkey.de" rel="nofollow">www.Cool-Monkey.de</a>.<br />
Hat evtl jemand eine Idee wo mein Fehler liegt?<br />
Oder eine Alternative, wie ich mein Bild in JPG umgewandelt bekomme (evtl jemand nen fertigen Code?)?<br />
Vielen Dank schonmal!</p>
<pre><code>void Hook(bool State)
{
	if(State == true){
		hDLL = LoadLibrary(&quot;convert2.dll&quot;);
		if(hDLL == NULL){
			MessageBox(NULL, &quot;Fehler beim Laden der DLL&quot;, &quot;Fehler&quot;, MB_OK);
		}
		Convert = (CONVERTER) GetProcAddress(hDLL,&quot;Convert&quot;);
		if(Convert == NULL){
			MessageBox(NULL, &quot;Fehler: Convert nicht gefunden in DLL.&quot;, &quot;Fehler&quot;, MB_OK);
		}
	}else{
		FreeLibrary(hDLL);
	}
}
int WINAPI WinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
{

	std::string path = &quot;C:\\neu.bmp&quot;;
	std::string format = &quot;JPG&quot;;
	std::string pathn = &quot;C:\\neu.jpg&quot;;
	LONG quali = 1;
	LONG bh = 0;

	SaveScreen(path); // erstellt einen Screenshot und speichert ihn unter path
	Hook(true);
	Sleep(1000);
	Convert(path,format,quali,bh,bh,pathn);
	Hook(false);

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1869377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1869377</guid><dc:creator><![CDATA[Verim]]></dc:creator><pubDate>Mon, 15 Mar 2010 15:57:55 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Mon, 15 Mar 2010 16:02:56 GMT]]></title><description><![CDATA[<p>Wie wäre es mit ganz normalem linken?<br />
Das ist ja nicht umsonst ne dll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1869384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1869384</guid><dc:creator><![CDATA[l&#x27;abra d&#x27;or]]></dc:creator><pubDate>Mon, 15 Mar 2010 16:02:56 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Thu, 18 Mar 2010 22:46:15 GMT]]></title><description><![CDATA[<p>Und was genau versteht du unter &quot;ganz normalem linken&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1871126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1871126</guid><dc:creator><![CDATA[Verim]]></dc:creator><pubDate>Thu, 18 Mar 2010 22:46:15 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Fri, 19 Mar 2010 00:25:33 GMT]]></title><description><![CDATA[<p>Ich hatte kürzlich mit der libjpeg zu tun und hab aus Neugier das Beispiel ausprobiert und bei mir hat's funktioniert. Was im Code nicht drinnen steht ist die Definition von CONVERTER. Intuitiv hab ich folgenden probiert:</p>
<pre><code class="language-cpp">typedef BOOL (WINAPI *CONVERTER)(LPCSTR lpFile, LPCSTR lpFormat, LONG lQuality, LONG lWidth, LONG lHeight, LPCSTR lpNewName);

CONVERTER Convert;
</code></pre>
<p>Da muss man aus den std-strings die char-pointer übergeben (wie bei vielen WinAPIs)</p>
<pre><code class="language-cpp">Convert(path.c_str(), format.c_str(), quali, bh,bh, pathn.c_str());
</code></pre>
<p>lg XOR <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/1871144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1871144</guid><dc:creator><![CDATA[xor]]></dc:creator><pubDate>Fri, 19 Mar 2010 00:25:33 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Fri, 19 Mar 2010 07:35:57 GMT]]></title><description><![CDATA[<p>Verim schrieb:</p>
<blockquote>
<p>Und was genau versteht du unter &quot;ganz normalem linken&quot;?</p>
</blockquote>
<p>Du kannst eigentlich jedem Kompiler (bzw. Linker) mitteilen, dass du gegen eine Bibliothek linken möchtest. Dann brauchst du nur noch eine Deklaration der Funktion, welche man sich meistens über die Header der Bibliothek reinholt, und du kannst die Funktion ganz normal aufrufen, wie jede andere Funktion auch. Also kein <code>LoadLibrary</code> und co mehr.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1871185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1871185</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Fri, 19 Mar 2010 07:35:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Wed, 24 Mar 2010 15:44:54 GMT]]></title><description><![CDATA[<p>Achja nur zur Auflösung der Sache:<br />
Das Problem war ein ganz simples. Ich habe ein std::string object anstelle eines char[]-strings übergeben. Einfacher Denkfehler ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1873400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1873400</guid><dc:creator><![CDATA[Verim]]></dc:creator><pubDate>Wed, 24 Mar 2010 15:44:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Wed, 24 Mar 2010 17:01:46 GMT]]></title><description><![CDATA[<p>l'abra d'or schrieb:</p>
<blockquote>
<p>Wie wäre es mit ganz normalem linken?<br />
Das ist ja nicht umsonst ne dll.</p>
</blockquote>
<p>Ähm, genau. Das ist nicht umsonst eine <em><strong>dynamic</strong> link library</em>, die man zur Laufzeit einbinden kann. Wie wäre es also mit ganz normalem statischen linken.<br />
Der Satz liest sich wie &quot;wie wäre es mit ganz normalem Fahren, ist schließlich nicht umsonst ein Flugzeug&quot;...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1873429</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1873429</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Wed, 24 Mar 2010 17:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit einbenden der DLL on Wed, 24 Mar 2010 19:51:53 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>Ähm, genau. Das ist nicht umsonst eine <em><strong>dynamic</strong> link library</em>, die man zur Laufzeit einbinden kann. Wie wäre es also mit ganz normalem statischen linken.</p>
</blockquote>
<p>Dir ist aber schon klar, dass zwischen dynamischem Linken und statischem Linken, obwohl beide beim Kompilieren angegeben wurden, ein RIESIGER Unterschied ist? Ich würde jedenfalls nicht gleich zu statischem Linken empfehlen, nur weil man etwas beim Kompilieren dazulinkt.</p>
<p>Das &quot;dynamic&quot; muss man nicht unbedingt so verstehen, dass man die Bibliothek selber per <code>LoadLibrary</code> lädt.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1873527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1873527</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Wed, 24 Mar 2010 19:51:53 GMT</pubDate></item></channel></rss>