<?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[So richtig die DLL geladen?]]></title><description><![CDATA[<p>Mal eine kleine Frage. Ich lade normalerweise so eine DLL</p>
<pre><code class="language-cpp">typedef int TFunc(int value = 5);
	TFunc *Func;

	HINSTANCE DLL = NULL;
	DLL = LoadLibrary(&quot;Custom.dll&quot;);
	if (DLL)
	{
		puts(&quot;DLL geladen&quot;);
		Func = (TFunc*)GetProcAddress(DLL, &quot;Func&quot;);
		if (Func)
		{
			printf(&quot;Rückgabe: %d&quot;,Func());
		}

		FreeLibrary(DLL);
	}

getch();
</code></pre>
<p>Er gibt mir auch einen Wert zurück (ob sinnvoll kann ich jetzt noch nicht sagen), jedoch crasht auch nach getch()(Programmende)</p>
<p>Sieht jemand einen Fehler bzw warum oder kann mir eine alternative zeigen, wie man sonst noch DLL lädt?</p>
<p>Es gibt da ja noch <strong>dllimport</strong>, aber damit habe ich noch nie was gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173357/so-richtig-die-dll-geladen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 01:03:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173357.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Feb 2007 14:03:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 14:03:28 GMT]]></title><description><![CDATA[<p>Mal eine kleine Frage. Ich lade normalerweise so eine DLL</p>
<pre><code class="language-cpp">typedef int TFunc(int value = 5);
	TFunc *Func;

	HINSTANCE DLL = NULL;
	DLL = LoadLibrary(&quot;Custom.dll&quot;);
	if (DLL)
	{
		puts(&quot;DLL geladen&quot;);
		Func = (TFunc*)GetProcAddress(DLL, &quot;Func&quot;);
		if (Func)
		{
			printf(&quot;Rückgabe: %d&quot;,Func());
		}

		FreeLibrary(DLL);
	}

getch();
</code></pre>
<p>Er gibt mir auch einen Wert zurück (ob sinnvoll kann ich jetzt noch nicht sagen), jedoch crasht auch nach getch()(Programmende)</p>
<p>Sieht jemand einen Fehler bzw warum oder kann mir eine alternative zeigen, wie man sonst noch DLL lädt?</p>
<p>Es gibt da ja noch <strong>dllimport</strong>, aber damit habe ich noch nie was gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228785</guid><dc:creator><![CDATA[fragenmeista]]></dc:creator><pubDate>Wed, 14 Feb 2007 14:03:28 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 15:58:36 GMT]]></title><description><![CDATA[<p>Das Laden sieht gut aus. Was kommt den für ein Crash?<br />
Wen ich raten soll: ist die DLL-Funktion als stdcall definiert und nicht cdecl?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228872</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Wed, 14 Feb 2007 15:58:36 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 16:07:55 GMT]]></title><description><![CDATA[<p>Pellaeon schrieb:</p>
<blockquote>
<p>Das Laden sieht gut aus. Was kommt den für ein Crash?</p>
</blockquote>
<p>&quot;exe hat ein Problem festgestellt und muss beendet werden.&quot;</p>
<p>Pellaeon schrieb:</p>
<blockquote>
<p>Wen ich raten soll: ist die DLL-Funktion als stdcall definiert und nicht cdecl?</p>
</blockquote>
<p>Wie genau meinst das? Ich bin nicht so der DLL-Experte.</p>
<p>Ich lade die DLL ja so</p>
<pre><code class="language-cpp">typedef int TFunc(int value = 5);
TFunc *Func;
</code></pre>
<p>Ich weiss das es soetwas gibt:</p>
<pre><code class="language-cpp">extern &quot;C&quot; __declspec(dllimport)double Func(int value = 5);
</code></pre>
<p>Aber ich glaube das ist VC++ only oder?<br />
Da erhalte ich auch nur ein: &quot;error LNK2001: Nichtaufgeloestes externes Symbol __imp__Func&quot;<br />
Das geht wohl nur wenn die DLL in EXE eingebunden ist oder?<br />
Ich möchte diese aber dynamisch laden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228887</guid><dc:creator><![CDATA[fragenmeista]]></dc:creator><pubDate>Wed, 14 Feb 2007 16:07:55 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 16:09:09 GMT]]></title><description><![CDATA[<p>Hast du die DLL selber geschrieben, ja?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228889</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228889</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Wed, 14 Feb 2007 16:09:09 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 16:14:49 GMT]]></title><description><![CDATA[<p>nope, das eine Fremd-DLL</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228896</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228896</guid><dc:creator><![CDATA[fragenmeista]]></dc:creator><pubDate>Wed, 14 Feb 2007 16:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 16:17:32 GMT]]></title><description><![CDATA[<p>Ups zu früh. Aber das habe ich dazubekommen.</p>
<pre><code class="language-cpp">extern &quot;C&quot; {
#define funktion __declspec(dllexport)
funktion int __stdcall Func(int value = 10);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1228904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228904</guid><dc:creator><![CDATA[fragenmeista]]></dc:creator><pubDate>Wed, 14 Feb 2007 16:17:32 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 16:42:25 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">typedef int __stdcall TFunc(int value = 5);
</code></pre>
<p>mach mal das bei dir <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228932</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Wed, 14 Feb 2007 16:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to So richtig die DLL geladen? on Wed, 14 Feb 2007 17:34:39 GMT]]></title><description><![CDATA[<p>Ahhh, super! Jetzt klappt es wunderbar. Vielen lieben Dank für die Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1228968</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1228968</guid><dc:creator><![CDATA[fragenmeista]]></dc:creator><pubDate>Wed, 14 Feb 2007 17:34:39 GMT</pubDate></item></channel></rss>