<?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&#x27;s verwenden??]]></title><description><![CDATA[<p>Hi</p>
<p>Ich habe immer wieder mal was über dlls im forum gelesen nun frage ich mich:<br />
Für was verwendet man die und wie, wikipedia spuckt nix brauchbares aus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/178181/dll-s-verwenden</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 17:08:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/178181.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 08 Apr 2007 17:49:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 17:49:06 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Ich habe immer wieder mal was über dlls im forum gelesen nun frage ich mich:<br />
Für was verwendet man die und wie, wikipedia spuckt nix brauchbares aus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261808</guid><dc:creator><![CDATA[Raxtor]]></dc:creator><pubDate>Sun, 08 Apr 2007 17:49:06 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 17:52:53 GMT]]></title><description><![CDATA[<p>Na, heute aber viele Fragen?</p>
<p>DLL's sind dazu da, wenn mehrere Programme auf ein und dieselben Funktionen zugreifen müssen/könnten/sollten. Bestes Beispiel hierfür sind wohl sämtliche WinAPI Funktionen. Sogut wie (fast) jedes Programm, dass auf deinem Rechner läuft, greift auf die API zu. Und diese Funktionen sind alle in DLL's ausgelagert, damit jedes Programm zur Laufzeit Zugriff darauf hat. (Mit Funktionen meine ich ganz normale Programmfunktionen, wie du sie z.B. in C++ schreibst)</p>
<p>MfG mikey.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261810</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261810</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 08 Apr 2007 17:52:53 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 17:57:09 GMT]]></title><description><![CDATA[<p>das geht doch auch wenn ich es in eine .h Datei schreibe und die überall include oder??<br />
noch was: kann ich diese dll's auch in c++ schreiben oder muss ich da eine neue Sprache lernen?</p>
<p>da du jetzt schon dabei bist willst du mir bitte auch die frage beantworten: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-178180.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-178180.html</a> ??</p>
<p>Danke schon mal für alle deine Antworten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261814</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261814</guid><dc:creator><![CDATA[Raxtor]]></dc:creator><pubDate>Sun, 08 Apr 2007 17:57:09 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 17:58:48 GMT]]></title><description><![CDATA[<p>Beispiel:</p>
<p>Du schreibst eine Funktion, die sagen wir mal, ein paar Anwendungen oft benötigen (z.B. Sleep () etc.). Dann ist es sinnvoll, diese Funktion als eine DLL zu kompilieren, um sie dann den Programmen zur Verfügung zu stellen. Denn sonst müsste bei jeder Anwendung diese Funktion extra mit in die *.exe kompiliert worden sein, was natürlich völlig überflüssig ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261816</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 08 Apr 2007 17:58:48 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 18:00:35 GMT]]></title><description><![CDATA[<p>muss ich dann auch</p>
<pre><code class="language-cpp">#include &quot;sleep.dll&quot;
</code></pre>
<p>schreiben oder wie geht das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261818</guid><dc:creator><![CDATA[Raxtor]]></dc:creator><pubDate>Sun, 08 Apr 2007 18:00:35 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 18:01:13 GMT]]></title><description><![CDATA[<p>Dazu hatten wir erst kürzlich einen ausführlichen Thread:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-177077-and-highlight-is-dll%2A.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-177077-and-highlight-is-dll*.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261820</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Sun, 08 Apr 2007 18:01:13 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 18:04:13 GMT]]></title><description><![CDATA[<blockquote>
<p>das geht doch auch wenn ich es in eine .h Datei schreibe und die überall include oder??</p>
</blockquote>
<p>Ja schon, aber NUR beim Kompilieren des Programmes. Der Sinn von DLL's ist ja, dass die verschiedenen Anwendungen zur <strong>Laufzeit</strong> auf die Funktionen der DLL's zugreifen können. Es ist z.B. nicht möglich, dass du eine eigene Funktion zum Ändern eines Registrywerts schreibst, denn das alles verwaltet Windows, und du hast keinen Zugriff darauf. Deshalb stellt Windows extra eine DLL zur Verfügung, in der die entsprechenden Funktionen definiert sind, damit alle Programme Zugriff auf die Registry haben (nur als Beispiel)</p>
<blockquote>
<p>noch was: kann ich diese dll's auch in c++ schreiben oder muss ich da eine neue Sprache lernen?</p>
</blockquote>
<p>Du kannst ganz normal C++ dafür hernehmen.</p>
<blockquote>
<p>da du jetzt schon dabei bist willst du mir bitte auch die frage beantworten: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-178180.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-178180.html</a> ??</p>
</blockquote>
<p>Sorry, habe hier kein Word sondern nur OpenOffice, deshalb kann ich dir da kaum helfen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261821</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261821</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 08 Apr 2007 18:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 18:11:41 GMT]]></title><description><![CDATA[<p>danke für eure antworten hab mich heute wieder mal weitergebildet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261825</guid><dc:creator><![CDATA[Raxtor]]></dc:creator><pubDate>Sun, 08 Apr 2007 18:11:41 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Sun, 08 Apr 2007 19:01:47 GMT]]></title><description><![CDATA[<p>Hab dir noch schnell nen Beispiel zum Laden einer DLL zusammengefrickelt:</p>
<p>Erstmal zur Defninition der Funktionen, die in der DLL ausgelagert werden sollen. Die folgende Datei wird dann zur DLL kompiliert:</p>
<p>dll.cpp:</p>
<pre><code class="language-cpp">#include &quot;dll.h&quot;
#include &lt;windows.h&gt;
#include &lt;iostream&gt;

void hallo()
{
  std::cout&lt;&lt;&quot;HALLO AUS DER DLL !!!!&quot;;
}

BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}
</code></pre>
<p>Nun die dazugehörige Headerdatei (benötigt man zur Kompilierung der DLL:)</p>
<pre><code class="language-cpp">#ifndef _DLL_H_
#define _DLL_H_

#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */

extern &quot;C&quot;
{
    DLLIMPORT void hallo ();
}

#endif
</code></pre>
<p>Nachdem du nun die DLL erfolgreich kompilert hast, kannst du sie nun wiefolgt anwenden;</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;

using namespace std;

typedef void (*ptrhallo)();

int main ()
{

     ptrhallo MeineDllFunktion;
     HINSTANCE hLib;

     //Holt mir das Handle auf die DLL
     hLib = LoadLibrary(&quot;Sleep.dll&quot;);
     BOOL status;

     if (hLib)
     {
          MeineDllFunktion = (ptrhallo) GetProcAddress(hLib, &quot;hallo&quot;);
          MeineDllFunktion ();
     }
     else
        cout &lt;&lt; &quot;Fehler: Konnte die Funktion nicht aufrufen&quot; &lt;&lt;&quot;\n&quot;;

     status = FreeLibrary(hLib); //Löst das Handle wieder
     getchar ();
     return 0;
}
</code></pre>
<p>Hoffe das hilft weiter... Könnte ich unten auch mal posten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
Verschiebt das bitte noch in's WinAPI Subforum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1261829</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1261829</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 08 Apr 2007 19:01:47 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Mon, 09 Apr 2007 08:40:56 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1262075</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1262075</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 09 Apr 2007 08:40:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Tue, 19 Jun 2007 18:50:50 GMT]]></title><description><![CDATA[<p>Hätte da noch ne Frage.</p>
<p>Könntest du vllt ein bissl mehr dazu erzählen ? :</p>
<p>mikey schrieb:</p>
<blockquote>
<pre><code class="language-cpp">BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
}
</code></pre>
</blockquote>
<p>Wozu ist das genau gut, wie läuft das eigentlich intern alles ab. Also wann kommt die DLLMain zum einsatz. Halt ein bissl Theorie. Habe nämlich nicht viel Plan von sowas <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309353</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309353</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 19 Jun 2007 18:50:50 GMT</pubDate></item><item><title><![CDATA[Reply to Dll&#x27;s verwenden?? on Tue, 19 Jun 2007 19:12:36 GMT]]></title><description><![CDATA[<p>Und nochwas. Wenn ich Klassen in dll's packe. Kann ich dann in dem Code, der die dll auruft auch Instanzen der Klasse anlegen und wie sieht das aus. Bei Funktion ist es ja mit Fkt.-Pointer getan und bei Klassen ???</p>
<p>Edit-&gt;Last:<br />
Wieso funktioniert hier :</p>
<pre><code class="language-cpp">extern &quot;C&quot; DLLIMPORT void hey() { };
</code></pre>
<p>auch ohne das DLLIMPORT ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309365</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 19 Jun 2007 19:12:36 GMT</pubDate></item></channel></rss>