<?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[Zugirff&#x2F;Namensauflösung von Variablen und Funktionen in DLL]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein tutorial gesehen, mit einer dll und folgendem DLL Code</p>
<pre><code class="language-cpp">__declspec(dllexport) int f;
__declspec(dllexport) void OutputBox()
{
 ShowMessage(f);
}
</code></pre>
<p>und nun der dynamische aufruf:</p>
<pre><code class="language-cpp">void __fastcall TForm2::dButtonClick(TObject *Sender)
{
typedef int Tf;
typedef void TOutputBox();
Tf* f;
TOutputBox* outputBox;

HINSTANCE h = LoadLibrary(&quot;var.dll&quot;);
if(h!=0)
   {
    f = (Tf*)GetProcAddress(h,&quot;_f&quot;);
    outputBox = (TOutputBox*)GetProcAddress(h,&quot;@OutputBox$qv&quot;);
   }
 if((f!=NULL)&amp;&amp;(outputBox!=NULL))
    {
     *f = StrToInt(dEdit-&gt;Text);
     outputBox();
    }
}
</code></pre>
<p>wieso bei GetProcAdress einmal &quot;_f&quot; und bei der Funktion dieses &quot;@OutputBox$qv&quot;??</p>
<p>Ist dies immer so?wenn ja, woher weiß ich das denn??</p>
<p>danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/167826/zugirff-namensauflösung-von-variablen-und-funktionen-in-dll</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 06:55:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167826.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Dec 2006 12:40:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zugirff&#x2F;Namensauflösung von Variablen und Funktionen in DLL on Fri, 15 Dec 2006 12:40:54 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein tutorial gesehen, mit einer dll und folgendem DLL Code</p>
<pre><code class="language-cpp">__declspec(dllexport) int f;
__declspec(dllexport) void OutputBox()
{
 ShowMessage(f);
}
</code></pre>
<p>und nun der dynamische aufruf:</p>
<pre><code class="language-cpp">void __fastcall TForm2::dButtonClick(TObject *Sender)
{
typedef int Tf;
typedef void TOutputBox();
Tf* f;
TOutputBox* outputBox;

HINSTANCE h = LoadLibrary(&quot;var.dll&quot;);
if(h!=0)
   {
    f = (Tf*)GetProcAddress(h,&quot;_f&quot;);
    outputBox = (TOutputBox*)GetProcAddress(h,&quot;@OutputBox$qv&quot;);
   }
 if((f!=NULL)&amp;&amp;(outputBox!=NULL))
    {
     *f = StrToInt(dEdit-&gt;Text);
     outputBox();
    }
}
</code></pre>
<p>wieso bei GetProcAdress einmal &quot;_f&quot; und bei der Funktion dieses &quot;@OutputBox$qv&quot;??</p>
<p>Ist dies immer so?wenn ja, woher weiß ich das denn??</p>
<p>danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192422</guid><dc:creator><![CDATA[jkss]]></dc:creator><pubDate>Fri, 15 Dec 2006 12:40:54 GMT</pubDate></item><item><title><![CDATA[Reply to Zugirff&#x2F;Namensauflösung von Variablen und Funktionen in DLL on Fri, 15 Dec 2006 12:51:12 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>der Unterstrich wird vom Compiler der DLL für den Funktionsnamen verwendet, wenn die Funktion als &quot;extern C&quot; exportiert wird. Das ist normal und üblich.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192435</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192435</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 15 Dec 2006 12:51:12 GMT</pubDate></item><item><title><![CDATA[Reply to Zugirff&#x2F;Namensauflösung von Variablen und Funktionen in DLL on Fri, 15 Dec 2006 12:54:17 GMT]]></title><description><![CDATA[<p>aber die variable f wurde nicht als extern &quot;C&quot; exportiert!<br />
und auch die Funktion OutputBox() nicht, wieso wird diese so &quot;kryptisch&quot; aufgerufen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192437</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192437</guid><dc:creator><![CDATA[jkss]]></dc:creator><pubDate>Fri, 15 Dec 2006 12:54:17 GMT</pubDate></item><item><title><![CDATA[Reply to Zugirff&#x2F;Namensauflösung von Variablen und Funktionen in DLL on Fri, 15 Dec 2006 15:13:58 GMT]]></title><description><![CDATA[<p>Dies ist das sogenannte C++ name mangling (d.h. die Parameter der Funktion sind im Namen mitcodiert - selbst bei einer Funktion mit keinen (void) Parametern).</p>
<p>Wenn du die DLL-Funktionen als extern &quot;C&quot; deklarierst, dann kannst du die einfachen Namen mit vorangestelltem &quot;_&quot; nutzen, z.b. &quot;_OutputBox&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192526</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Fri, 15 Dec 2006 15:13:58 GMT</pubDate></item></channel></rss>