<?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[Mehrere DLLs dynamisch einbinden?]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich hab volgendes Problem. Ich will mehrere DLLs in mein Programm einbinden. Es könnten mal 2 DLLs sein aber auch mal 20 :).<br />
Wie ich eine DLL dynamisch einbinde steht hier:</p>
<pre><code class="language-csharp">// Unit1.h
//---------------
private:	// User declarations
    HINSTANCE DllInstance;

// Unit1.cpp
//---------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) {

    if (!DllInstance) DllInstance = LoadLibrary(&quot;test.dll&quot;);
    if (DllInstance) ShowMessage(&quot;DLL geladen&quot;);

    if (DllInstance)
        DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;_CheckCommand&quot;);
    else ShowMessage(&quot;Bitte DLL laden&quot;)

    if (DllFunktion) Memo1-&gt;Text = DllFunktion(&quot;EnvironVar&gt;&quot;);
    else ShowMessage(&quot;Funktionsname existiert nicht&quot;);
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
    if (DllInstance)
        if (FreeLibrary(DllInstance)) DllInstance = NULL; // DLL entladen
    if (!DllInstance) ShowMessage(&quot;DLL nicht geladen.&quot;);
}
</code></pre>
<p>Aber wie bekomme ich es hin das zum Beispiel alle DLLs, die in einer ListBox eingetragen sind nacheinander in das Programm eingebunden werden? Und das ich diese DLLs auch einzell wieder entladen kann.</p>
<p>Also das müsste mit einer Klasse gehen aber ich weiss nicht genau wie?</p>
<p>Kann mir da jemand weiterhelfen? wär echt cool <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>
<p>Danke...... !!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/74652/mehrere-dlls-dynamisch-einbinden</link><generator>RSS for Node</generator><lastBuildDate>Sun, 28 Jun 2026 02:33:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/74652.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 May 2004 12:41:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mehrere DLLs dynamisch einbinden? on Sun, 23 May 2004 12:41:34 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich hab volgendes Problem. Ich will mehrere DLLs in mein Programm einbinden. Es könnten mal 2 DLLs sein aber auch mal 20 :).<br />
Wie ich eine DLL dynamisch einbinde steht hier:</p>
<pre><code class="language-csharp">// Unit1.h
//---------------
private:	// User declarations
    HINSTANCE DllInstance;

// Unit1.cpp
//---------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) {

    if (!DllInstance) DllInstance = LoadLibrary(&quot;test.dll&quot;);
    if (DllInstance) ShowMessage(&quot;DLL geladen&quot;);

    if (DllInstance)
        DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;_CheckCommand&quot;);
    else ShowMessage(&quot;Bitte DLL laden&quot;)

    if (DllFunktion) Memo1-&gt;Text = DllFunktion(&quot;EnvironVar&gt;&quot;);
    else ShowMessage(&quot;Funktionsname existiert nicht&quot;);
}

void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
    if (DllInstance)
        if (FreeLibrary(DllInstance)) DllInstance = NULL; // DLL entladen
    if (!DllInstance) ShowMessage(&quot;DLL nicht geladen.&quot;);
}
</code></pre>
<p>Aber wie bekomme ich es hin das zum Beispiel alle DLLs, die in einer ListBox eingetragen sind nacheinander in das Programm eingebunden werden? Und das ich diese DLLs auch einzell wieder entladen kann.</p>
<p>Also das müsste mit einer Klasse gehen aber ich weiss nicht genau wie?</p>
<p>Kann mir da jemand weiterhelfen? wär echt cool <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>
<p>Danke...... !!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/525594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/525594</guid><dc:creator><![CDATA[action_jackson]]></dc:creator><pubDate>Sun, 23 May 2004 12:41:34 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere DLLs dynamisch einbinden? on Mon, 24 May 2004 06:14:51 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>also erstmal muss ich kurz &quot;meckern&quot;. Deine Art und Weise zu prüfen, ob ein Handle NULL ist oder nicht, finde ich unübersichtlich und hat mich am Anfang auch verwirrt. Ich wäre eher für die leserliche Variante, aber das ist jedem seine Sache. <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>
<p>Zu deiner Frage. Ich hab das zwar noch nicht gemacht, aber es müsste doch möglich sein den Eintrag, der angeklickt ist, aus der ListBox auszulesen und ihn als String an <strong>LoadLibrary</strong> zu übergeben, oder nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/526050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526050</guid><dc:creator><![CDATA[Maffe001]]></dc:creator><pubDate>Mon, 24 May 2004 06:14:51 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrere DLLs dynamisch einbinden? on Mon, 24 May 2004 12:16:43 GMT]]></title><description><![CDATA[<p>hab ich zwar noch nicht ausprobiert aber klingt garnicht mal so verkehrt...</p>
<p>hehe <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="🙂"
    /> ich probiert das mal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/526236</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/526236</guid><dc:creator><![CDATA[action_jackson]]></dc:creator><pubDate>Mon, 24 May 2004 12:16:43 GMT</pubDate></item></channel></rss>