<?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[DLL dynamisch laden: Bei Funktionsaufruf Fehler!?]]></title><description><![CDATA[<p>Hallo Forum,</p>
<p>ich möchte die Funktionen einer dynamischen DLL benutzen.</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;stdio.h&gt;
#include &lt;windows.h&gt; 

int main(){
	double retval=0;
	HINSTANCE DllInstance=0;
	typedef double (__stdcall *IMPFUNC) (double, double);
	IMPFUNC DllFunktion;

	DllInstance = LoadLibrary(&quot;ABC.DLL&quot;);
	if (DllInstance) {
		DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;myfunc&quot;);
		retval = DllFunktion(1.1, 2.2);
	} 
	if (DllInstance)
		if (FreeLibrary(DllInstance))  
			DllInstance = NULL;

	return 0;
}
</code></pre>
<p>Bei &quot;retval = DllFunktion(1.1, 2.2);&quot; gibt es einen Fehler: Unbehandelte Ausnahme.<br />
Wenn ich in Excel bin kann ich die Funktion so einbinden:</p>
<pre><code>Declare Function myfunc Lib &quot;abc.DLL&quot; (ByRef p As Double, ByRef T As Double) As Double
</code></pre>
<p>Wo liegt der Fehler? (Excel benutzt stdcall.)</p>
<p>Marlon</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/69853/dll-dynamisch-laden-bei-funktionsaufruf-fehler</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 08:12:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/69853.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Apr 2004 10:20:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL dynamisch laden: Bei Funktionsaufruf Fehler!? on Thu, 01 Apr 2004 10:20:33 GMT]]></title><description><![CDATA[<p>Hallo Forum,</p>
<p>ich möchte die Funktionen einer dynamischen DLL benutzen.</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;stdio.h&gt;
#include &lt;windows.h&gt; 

int main(){
	double retval=0;
	HINSTANCE DllInstance=0;
	typedef double (__stdcall *IMPFUNC) (double, double);
	IMPFUNC DllFunktion;

	DllInstance = LoadLibrary(&quot;ABC.DLL&quot;);
	if (DllInstance) {
		DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;myfunc&quot;);
		retval = DllFunktion(1.1, 2.2);
	} 
	if (DllInstance)
		if (FreeLibrary(DllInstance))  
			DllInstance = NULL;

	return 0;
}
</code></pre>
<p>Bei &quot;retval = DllFunktion(1.1, 2.2);&quot; gibt es einen Fehler: Unbehandelte Ausnahme.<br />
Wenn ich in Excel bin kann ich die Funktion so einbinden:</p>
<pre><code>Declare Function myfunc Lib &quot;abc.DLL&quot; (ByRef p As Double, ByRef T As Double) As Double
</code></pre>
<p>Wo liegt der Fehler? (Excel benutzt stdcall.)</p>
<p>Marlon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/492910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/492910</guid><dc:creator><![CDATA[marlon]]></dc:creator><pubDate>Thu, 01 Apr 2004 10:20:33 GMT</pubDate></item><item><title><![CDATA[Reply to DLL dynamisch laden: Bei Funktionsaufruf Fehler!? on Thu, 01 Apr 2004 10:42:38 GMT]]></title><description><![CDATA[<p>Ach ja: Wenn ich mit tdump an die dll herangehe bekomme ich diesen Funktionsausszug:</p>
<p>00001210 12 0000 MYFUNC</p>
<p>Eben habe ich es MYFUNC in meinem Prog auch groß geschrieben. Immer noch der selbe Fehler.<br />
In &quot;DllFunktion&quot; steht nach dieser Zeile &quot;DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;myfunc&quot;);&quot; auch die &quot;1210&quot; drin. Scheint richtig geladen worden zu sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/492927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/492927</guid><dc:creator><![CDATA[marlon]]></dc:creator><pubDate>Thu, 01 Apr 2004 10:42:38 GMT</pubDate></item><item><title><![CDATA[Reply to DLL dynamisch laden: Bei Funktionsaufruf Fehler!? on Thu, 01 Apr 2004 12:43:56 GMT]]></title><description><![CDATA[<p>Die Frage ist nicht mehr wichtig. Ich steuere Excel an. Ist zwar dreckig... es muß aber fertig werden;-)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/493056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/493056</guid><dc:creator><![CDATA[marlon]]></dc:creator><pubDate>Thu, 01 Apr 2004 12:43:56 GMT</pubDate></item><item><title><![CDATA[Reply to DLL dynamisch laden: Bei Funktionsaufruf Fehler!? on Fri, 02 Apr 2004 10:34:34 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>gerade jetzt ist die Frage wieder wichtig geworden;-)<br />
Kann es sein das meine dll eine ActiveX dll ist?<br />
Eine normale C DLL hat bei tdump diesen Eintrag:<br />
Flags 210E [ executable backwards 32bit library ]</p>
<p>Die dll die ich laden will hat diesen Eintrag:<br />
Flags A18E [ executable 32bit library ]</p>
<p>Könnte es sein das &quot;executable 32bit library &quot; eine ActiveX dll meint?</p>
<p>Marlon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/493693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/493693</guid><dc:creator><![CDATA[marlon]]></dc:creator><pubDate>Fri, 02 Apr 2004 10:34:34 GMT</pubDate></item><item><title><![CDATA[Reply to DLL dynamisch laden: Bei Funktionsaufruf Fehler!? on Fri, 02 Apr 2004 14:17:54 GMT]]></title><description><![CDATA[<p>Sagt GetLastError() was brauchbares?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/493888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/493888</guid><dc:creator><![CDATA[Bufferoverflow]]></dc:creator><pubDate>Fri, 02 Apr 2004 14:17:54 GMT</pubDate></item></channel></rss>