<?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[Zugriff auf Klasse in einer DLL]]></title><description><![CDATA[<p>Hi,<br />
ich benötige mal wieder eure Hilfe.</p>
<p>Ich hab ein MFC-Programm gemacht un dmöchte jetzt auf eine DLL zugreiffen.<br />
Die DLL ist recht einfach.<br />
eine Funktion (&quot;Funktion&quot;), eine Variable (&quot;variable&quot;) und eine Klasse (&quot;class object&quot;).</p>
<p>Ich mach dann folgendes:</p>
<pre><code>typedef int (CALLBACK* Func)(void);
typedef int* (Var);

Func Krahni_Funktion; 
Var Krahni_Variable;

int egal(void)
{
   HINSTANCE hLib = AfxLoadLibrary(&quot;DLL.DLL&quot;);

   if(hLib)
   {
      Krahni_Funktion = (Func)GetProcAddress(hLib, &quot;Funktion&quot;);

      if(Krahni_Funktion)
      {
	Krahni_Funktion();
      }
      else
      {
         AfxFreeLibrary(hLib);
      }

      Krahni_Variable = (Var)GetProcAddress(hLib, &quot;Variable&quot;);

      if(Krahni_Variable)
      {
	int sicher = *Krahni_Variable;
      }
      else
      {
         AfxFreeLibrary(hLib);
      }
   }
}
</code></pre>
<p>Das klappt auch alles wunderbar.<br />
Nur wie bekomm ich jetzt zugriff auf die Klasse?</p>
<p>Danke für jede Hilfe</p>
<p>Gruss</p>
<p>Dragon Fire</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/45866/zugriff-auf-klasse-in-einer-dll</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 11:38:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/45866.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Aug 2003 11:53:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 11:53:54 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich benötige mal wieder eure Hilfe.</p>
<p>Ich hab ein MFC-Programm gemacht un dmöchte jetzt auf eine DLL zugreiffen.<br />
Die DLL ist recht einfach.<br />
eine Funktion (&quot;Funktion&quot;), eine Variable (&quot;variable&quot;) und eine Klasse (&quot;class object&quot;).</p>
<p>Ich mach dann folgendes:</p>
<pre><code>typedef int (CALLBACK* Func)(void);
typedef int* (Var);

Func Krahni_Funktion; 
Var Krahni_Variable;

int egal(void)
{
   HINSTANCE hLib = AfxLoadLibrary(&quot;DLL.DLL&quot;);

   if(hLib)
   {
      Krahni_Funktion = (Func)GetProcAddress(hLib, &quot;Funktion&quot;);

      if(Krahni_Funktion)
      {
	Krahni_Funktion();
      }
      else
      {
         AfxFreeLibrary(hLib);
      }

      Krahni_Variable = (Var)GetProcAddress(hLib, &quot;Variable&quot;);

      if(Krahni_Variable)
      {
	int sicher = *Krahni_Variable;
      }
      else
      {
         AfxFreeLibrary(hLib);
      }
   }
}
</code></pre>
<p>Das klappt auch alles wunderbar.<br />
Nur wie bekomm ich jetzt zugriff auf die Klasse?</p>
<p>Danke für jede Hilfe</p>
<p>Gruss</p>
<p>Dragon Fire</p>
]]></description><link>https://www.c-plusplus.net/forum/post/331996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/331996</guid><dc:creator><![CDATA[Dragon Fire]]></dc:creator><pubDate>Thu, 14 Aug 2003 11:53:54 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 11:57:58 GMT]]></title><description><![CDATA[<p>Linke die DLL doch statisch.</p>
<p>Sonst müsstest du die genauen Methodennamen kennen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332002</guid><dc:creator><![CDATA[*aleph_0]]></dc:creator><pubDate>Thu, 14 Aug 2003 11:57:58 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 12:11:49 GMT]]></title><description><![CDATA[<p>ich wollts gern dynamisch machen.</p>
<p>Die genauen Namen kenn ich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332014</guid><dc:creator><![CDATA[Dragon Fire]]></dc:creator><pubDate>Thu, 14 Aug 2003 12:11:49 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 12:20:14 GMT]]></title><description><![CDATA[<p>AFAIK können nur MFC-DLLs Klassen exportieren. Diese DLLs können dann aber auch nur MFC-Programme verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332024</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332024</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Thu, 14 Aug 2003 12:20:14 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 12:25:50 GMT]]></title><description><![CDATA[<p>Mit Win32-DLLs geht das nicht? Dann kann ich ja lange rumprobieren...</p>
<p>Hat einer ne Ahnung warum das so ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332034</guid><dc:creator><![CDATA[Dragon Fire]]></dc:creator><pubDate>Thu, 14 Aug 2003 12:25:50 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 12:29:07 GMT]]></title><description><![CDATA[<p>Mit Win32-DLLs geht das nicht? Dann kann ich ja lange rumprobieren...</p>
<p>Hat einer ne Ahnung warum das so ist?</p>
<p>Wenn ich aber ein neues Projekt anlege Win32-DLL mit der angebe &quot;Eine DLL, die einige Symbole exportiert&quot; passiert folgendes....</p>
<p>er legt ne Variable, eine Funktion und ne Klasse an.<br />
Warum ne Klasse wenn er sie eh nicht exportieren kann? Also kann ich klassen nur innerhalb der DLL verwenden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332042</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332042</guid><dc:creator><![CDATA[Dragon Fire]]></dc:creator><pubDate>Thu, 14 Aug 2003 12:29:07 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 12:59:34 GMT]]></title><description><![CDATA[<p>Die Klasse wird natürlich exportiert, wenn da EXPORT davorsteht.<br />
Aber das Exportieren von Klassen läuft dann über dermaßen komische Krücken, das bringt dir nicht wirklich was.<br />
Du kannst die DLL dann nämlich nur mit dem MS-Compiler (evtl. nur in einer bestimmten Version) verwenden. Bei anderen Compilern klappen die Krücken nicht nicht mehr und du musst die dekorierten Methodennamen in Erfahrung bringen und und und.... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/332072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332072</guid><dc:creator><![CDATA[Christoph]]></dc:creator><pubDate>Thu, 14 Aug 2003 12:59:34 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 13:04:04 GMT]]></title><description><![CDATA[<p>Und bei MFC-DLLs geht das besser? Oder ist es generell nichts geschickt Klassen in DLL's zu lagern?</p>
<p>Mich würde trotzdem mal interressieren wie das funktioniert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332076</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332076</guid><dc:creator><![CDATA[Dragon Fire]]></dc:creator><pubDate>Thu, 14 Aug 2003 13:04:04 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 13:17:57 GMT]]></title><description><![CDATA[<p><a href="http://www.mut.de/media_remote/buecher/VCPLUS6/data/kap17.htm" rel="nofollow">http://www.mut.de/media_remote/buecher/VCPLUS6/data/kap17.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/332089</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332089</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Thu, 14 Aug 2003 13:17:57 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriff auf Klasse in einer DLL on Thu, 14 Aug 2003 13:33:13 GMT]]></title><description><![CDATA[<p>Man kann auch Klassen in DLL dynamisch laden.<br />
Einfach erklärt: Ein exportierte Funktion erstellt eine Instanz der Klasse und diese wird bei GetProcAdress abgeholt&quot;.<br />
Solltest du das jetzt nicht verstehen dann lass es da dies nicht der normale Weg ist.<br />
Die MFC geht davon aus, daß Exportierte Klassen statisch eingebunden werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/332105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/332105</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Thu, 14 Aug 2003 13:33:13 GMT</pubDate></item></channel></rss>