<?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[[Gelöst] Funktionsaufruf aus DLL schlägt fehl]]></title><description><![CDATA[<p>Hallo,</p>
<p>folgender Code meiner DLL:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#include &lt;windows.h&gt;
#pragma hdrstop

// C++Builder-Kommentare

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
        return 1;
}
//---------------------------------------------------------------------------

__declspec(dllexport) void func()
{
  ShowMessage(&quot;hallo&quot;);
}
</code></pre>
<p>und meiner Host-Anwendung</p>
<pre><code class="language-cpp">//FAQ-Quelltext
typedef void (* DLLFUNCTION1PROC)(void);

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    HMODULE hMyLib;
    DLLFUNCTION1PROC pfnDllFunction1 = NULL;

    hMyLib = LoadLibrary(&quot;..\\dll\\Project1.dll&quot;);
    if (hMyLib == NULL) {
        ShowMessage(&quot;nicht gefunden&quot;);
        return;
    }
    pfnDllFunction1 = (DLLFUNCTION1PROC)GetProcAddress(hMyLib, &quot;_func&quot;);
    if (pfnDllFunction1 == NULL) {
        ShowMessage(&quot;funktion fehlt&quot;);
        return;
    }

    pfnDllFunction1();

    FreeLibrary(hMyLib);

}
</code></pre>
<p>Warum kann GetProcAddress _func nicht finden (Meldung &quot;funktion fehlt&quot; kommt)?</p>
<p>Danke schon mal im voraus!</p>
<p>[EDIT] Gesucht habe ich schon vergeblich! Ich bin auch für Stichwörter dankbar. BTW: Wie heißt dieses Tool, mit dem man sich alle exportierten Funktionen einer DLL auflisten lassen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/126580/gelöst-funktionsaufruf-aus-dll-schlägt-fehl</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Jul 2026 18:48:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/126580.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Nov 2005 13:34:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Gelöst] Funktionsaufruf aus DLL schlägt fehl on Wed, 16 Nov 2005 13:43:12 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>folgender Code meiner DLL:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#include &lt;windows.h&gt;
#pragma hdrstop

// C++Builder-Kommentare

#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
        return 1;
}
//---------------------------------------------------------------------------

__declspec(dllexport) void func()
{
  ShowMessage(&quot;hallo&quot;);
}
</code></pre>
<p>und meiner Host-Anwendung</p>
<pre><code class="language-cpp">//FAQ-Quelltext
typedef void (* DLLFUNCTION1PROC)(void);

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    HMODULE hMyLib;
    DLLFUNCTION1PROC pfnDllFunction1 = NULL;

    hMyLib = LoadLibrary(&quot;..\\dll\\Project1.dll&quot;);
    if (hMyLib == NULL) {
        ShowMessage(&quot;nicht gefunden&quot;);
        return;
    }
    pfnDllFunction1 = (DLLFUNCTION1PROC)GetProcAddress(hMyLib, &quot;_func&quot;);
    if (pfnDllFunction1 == NULL) {
        ShowMessage(&quot;funktion fehlt&quot;);
        return;
    }

    pfnDllFunction1();

    FreeLibrary(hMyLib);

}
</code></pre>
<p>Warum kann GetProcAddress _func nicht finden (Meldung &quot;funktion fehlt&quot; kommt)?</p>
<p>Danke schon mal im voraus!</p>
<p>[EDIT] Gesucht habe ich schon vergeblich! Ich bin auch für Stichwörter dankbar. BTW: Wie heißt dieses Tool, mit dem man sich alle exportierten Funktionen einer DLL auflisten lassen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/919154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/919154</guid><dc:creator><![CDATA[picocat]]></dc:creator><pubDate>Wed, 16 Nov 2005 13:43:12 GMT</pubDate></item><item><title><![CDATA[Reply to [Gelöst] Funktionsaufruf aus DLL schlägt fehl on Wed, 16 Nov 2005 13:44:31 GMT]]></title><description><![CDATA[<p>Sorry, dass ich mal wieder vorschnell war. Hab das Problem selbst gefunden. Mit dem Dependency Walker von MS (über Wikipedia gefunden), habe ich herausgefunden, dass die Funktion @func$qv heißt. Setze ich ein extern &quot;C&quot; vor __declspec(dllexport), ist func als _func verfügbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/919171</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/919171</guid><dc:creator><![CDATA[picocat]]></dc:creator><pubDate>Wed, 16 Nov 2005 13:44:31 GMT</pubDate></item></channel></rss>