<?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 Problem]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe einen Funktionspointer einer Funktion einer DLL in einer anderen DLL. Wenn ich jetzt den Pointer ausführe, kommt der Fehler:</p>
<pre><code>Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
</code></pre>
<p>Leider kann ich mir den Fehler nicht erklären. Die Deffinition des Funktionpointers ist</p>
<pre><code class="language-cpp">int			(WINAPI* pImportFunc)(char*);
</code></pre>
<p>(WINAPI ist __stdcall) und die Funktion wird in meiner WndProc (auch WINAPI, statische Memberfunktion einer Klasse) ausgeführt. Eigentlich sind ja dann die calling convention gleich, oder?</p>
<p>Danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/79318/dll-problem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 21:32:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/79318.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Jul 2004 20:20:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL Problem on Fri, 09 Jul 2004 20:20:28 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe einen Funktionspointer einer Funktion einer DLL in einer anderen DLL. Wenn ich jetzt den Pointer ausführe, kommt der Fehler:</p>
<pre><code>Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
</code></pre>
<p>Leider kann ich mir den Fehler nicht erklären. Die Deffinition des Funktionpointers ist</p>
<pre><code class="language-cpp">int			(WINAPI* pImportFunc)(char*);
</code></pre>
<p>(WINAPI ist __stdcall) und die Funktion wird in meiner WndProc (auch WINAPI, statische Memberfunktion einer Klasse) ausgeführt. Eigentlich sind ja dann die calling convention gleich, oder?</p>
<p>Danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557139</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Fri, 09 Jul 2004 20:20:28 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Fri, 09 Jul 2004 21:41:05 GMT]]></title><description><![CDATA[<p>Aber ist die Funktion selber auch __stdcall?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557193</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557193</guid><dc:creator><![CDATA[Ringding]]></dc:creator><pubDate>Fri, 09 Jul 2004 21:41:05 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 08:26:47 GMT]]></title><description><![CDATA[<p>Ja, der Funktionspointer ist WINAPI sowie die DllMain und die WndProc funktion. (In der WndProc wird der Pointer aufgerufen).</p>
<p>Vielleicht liegt hier auch das Problem: Ich habe ja den DLL-Funktionspointer in einer DLL aufgerufen. Wobei an anderer Stelle daselbe funktioniert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557279</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 10 Jul 2004 08:26:47 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 10:29:57 GMT]]></title><description><![CDATA[<p>Dass der Funktionspointer __stdcall ist, sagtest du schon, das sieht man ja auch an deinem Code. Aber ich will wissen, ob die Funktion selber (also die in der anderen DLL) auch mit __stdcall compiliert wurde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557327</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557327</guid><dc:creator><![CDATA[Ringding]]></dc:creator><pubDate>Sat, 10 Jul 2004 10:29:57 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 10:54:45 GMT]]></title><description><![CDATA[<p>Ich weiß zwar nciht so genau, was du meinst, aber die Funktion, auf die der Funktionspointer zeigt ist wiefolgt deffiniert:</p>
<pre><code class="language-cpp">extern &quot;C&quot;
{
	__declspec(dllexport) int TEST_FUNC(char* pFileName)
	{
// ...
         }
}
</code></pre>
<p>Danke,</p>
<p>Chrissi</p>
<p>PS: Und die WinMain, die die DLL (mit dem Funktionspointer auf die andere DLL aufruft) ist auch WINAPI</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557341</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 10 Jul 2004 10:54:45 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 10:55:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">extern &quot;C&quot;
{
	__declspec(dllexport) int WINAPI TEST_FUNC(char* pFileName)
	{
// ...
         }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/557345</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557345</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Sat, 10 Jul 2004 10:55:43 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 12:10:39 GMT]]></title><description><![CDATA[<p>Ist die Funktion in der DLL, die du aufrufen willst, nicht von dir?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557407</guid><dc:creator><![CDATA[Ringding]]></dc:creator><pubDate>Sat, 10 Jul 2004 12:10:39 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 17:39:08 GMT]]></title><description><![CDATA[<p>*PUSH*</p>
<p>-&gt;Muss noch mal überlegen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557644</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 10 Jul 2004 17:39:08 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 21:24:24 GMT]]></title><description><![CDATA[<p>So,</p>
<p>habe eine kleine Pause gemacht (ich war in einem schönen Konzert des Dresdner Kreuzkores...) und gedacht habe ich auch (mal)...</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/2053">@Hepi</a>: Deine Lösung könnte funktionieren, wobei meine Rechner die Funktion mit WINAPI neben dem int nicht per GetProcAdress findet. Vielleicht gibt es da ja aber auch andere Möglichkeiten, eine Funktion in einer DLL-Datei zu finden...</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/6165">@RingDing</a>: Die Funktion ist natürlich von mir, wobei zur Komplimierung durch den Compiler nur der Funktionskopf (__declspec(dllexport) int TEST_FUNC(char* pFileName) )bekannt ist. Der Funktionsrumpf ist unbekannt.</p>
<p>Ich hoffe, jemand kann mir helfen,</p>
<p>danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557827</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557827</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 10 Jul 2004 21:24:24 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 22:10:24 GMT]]></title><description><![CDATA[<p>Sofern du keine .DEF-Datei erstellst (siehe MSDN), wird extern &quot;C&quot; int __stdcall TEST_FUNC(char*); mit dem Namen &quot;_TEST_FUNC@4&quot; exportiert (@4 = Anzahl Bytes in der Parameterliste). Das solltest du mit GetProcAddress finden können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557843</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557843</guid><dc:creator><![CDATA[tag]]></dc:creator><pubDate>Sat, 10 Jul 2004 22:10:24 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Sat, 10 Jul 2004 23:43:45 GMT]]></title><description><![CDATA[<p>Wenn der Funktionskopf so ausschaut, wie du es angibst, dann ist es kein Wunder, dass es nicht geht.</p>
<blockquote>
<p>This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.</p>
</blockquote>
<p>Das sagt eigentlich alles. Du hast ohne WINAPI compiliert, versucht sie aber mit WINAPI aufzurufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557873</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557873</guid><dc:creator><![CDATA[Ringding]]></dc:creator><pubDate>Sat, 10 Jul 2004 23:43:45 GMT</pubDate></item></channel></rss>