<?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[Wie kann man DLL verbinden]]></title><description><![CDATA[<p>ich bin Anfänger mit C++ Builder und kann ich nicht Dll mit einem Programm<br />
verbinden. Kann jemend mir helfen, Bitte.<br />
vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/115802/wie-kann-man-dll-verbinden</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Jul 2026 12:07:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/115802.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Jul 2005 09:36:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie kann man DLL verbinden on Tue, 19 Jul 2005 09:36:08 GMT]]></title><description><![CDATA[<p>ich bin Anfänger mit C++ Builder und kann ich nicht Dll mit einem Programm<br />
verbinden. Kann jemend mir helfen, Bitte.<br />
vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/834193</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/834193</guid><dc:creator><![CDATA[Wa Chan]]></dc:creator><pubDate>Tue, 19 Jul 2005 09:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man DLL verbinden on Tue, 19 Jul 2005 09:37:23 GMT]]></title><description><![CDATA[<p><a href="http://www.marquardtnet.info/cecke/tutorials.8/8_dll.html" rel="nofollow">http://www.marquardtnet.info/cecke/tutorials.8/8_dll.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/834197</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/834197</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Tue, 19 Jul 2005 09:37:23 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man DLL verbinden on Tue, 19 Jul 2005 13:44:54 GMT]]></title><description><![CDATA[<p>ich habe nicht geschaft. Wer kann auf dateien kocken und sagt welche fehler habe ich gemacht. Helfensie mir,bitte. vielen dank<br />
in datei .cpp</p>
<pre><code class="language-cpp">#include &lt;vcl.h&gt;
#pragma hdrstop
#include &quot;UnitMain.h&quot;
#include &lt;windef.h&gt;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TFormMain *FormMain;
//---------------------------------------------------------------------------
__fastcall TFormMain::TFormMain(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
HINSTANCE hdll;
hdll = ::LoadLibrary(&quot;Dll_C.dll&quot;);
void (__stdcall* Plus)(int);
void (__stdcall* Minus)(int);

Plus =(void(__stdcall*)(int))GetProcAddress(hdll,&quot;_Plus&quot;);
Minus =(void(__stdcall*)(int))GetProcAddress(hdll,&quot;_Minus&quot;);

FreeLibrary(hdll);
//---------------------------------------------------------------------------
void __fastcall TFormMain::BtnMinusClick(TObject *Sender)
{
  int a, b, s;
  a = StrToInt(Edit1-&gt;Text);
  b = StrToInt(Edit2-&gt;Text);
  s = Minus(a,b);
  Label-&gt;Caption = IntToStr(s);
}

 in dataei .header

#ifdef __DLL__
#	define DLL_TYP __declspec(dllexport)
#else
#	define DLL_TYP __declspec(dllimport)
#ifndef UnitMainH
#define UnitMainH
#ifndef GFILEH
#define GFILEH
#endif
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;ComCtrls.hpp&gt;
#include &lt;CmAdmCtl.hpp&gt;
#include &lt;OleServer.hpp&gt;
//---------------------------------------------------------------------------
class TFormMain : public TForm
{ class DLL_TYP TFormMain : public TForm

__published:	// Von der IDE verwaltete Komponenten
        TButton *BtnPlus;
        TRadioButton *RBCom;
        TCOMAdminCatalog *COMAdminCatalog;
        TLabel *LbComPort;
        TButton *BtnMinus;
        TEdit *Edit1;
        TEdit *Edit2;
        TLabel *Label1;
        void __fastcall BtnConnectClick(TObject *Sender);
        void __fastcall BtnMinusClick(TObject *Sender);
        void __fastcall BtnPlusClick(TObject *Sender);
private:	// Anwender-Deklarationen
        typedef int Plus(int x, int y);
        typedef int Minus(int x, int y);

        DLLFUNCTION *pDllFunction;
public:		// Anwender-Deklarationen
        __fastcall TFormMain(TComponent* Owner);

        DLL_TYP();
        void CallDllFunction();
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/834389</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/834389</guid><dc:creator><![CDATA[Wa Chan]]></dc:creator><pubDate>Tue, 19 Jul 2005 13:44:54 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man DLL verbinden on Tue, 19 Jul 2005 13:55:24 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>du hast da etwas aus dem Tut überlesen :</p>
<blockquote>
<p>Nun kann die Funkiton genutzt werden. Ist die DLL nicht mehr vonnöten muß diese freigegeben werden:<br />
FreeLibrary(hdll);</p>
</blockquote>
<p>Das heißt sowohl deine ganze Initialisierung als auch die Freigabe der DLL-Funktionen sollte in Funktionen, die zu den richtigen Zeitpunkten aufgerufen wird.<br />
Vorzugsweise die Initialisierung in den Konstruktor und die Freigabe in den Destruktors des Forms.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/834399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/834399</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 19 Jul 2005 13:55:24 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man DLL verbinden on Tue, 19 Jul 2005 14:19:38 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Vielleicht schaust du auch nochmal in dieses Tutorial<br />
<a href="http://bcb-tutorial.c-plusplus.net/DLL_Tutorial/index.html" rel="nofollow">http://bcb-tutorial.c-plusplus.net/DLL_Tutorial/index.html</a><br />
Das ist etwas umfangreicher als das Andere.<br />
Noch weitere Bemerkungen:<br />
- kontrolliere nach LoadLibrary ob das Laden erfolgreich war (hdll != 0)<br />
- kontrolliere nach GetProcAddress ob das Laden der Funktionen erfolgreich war (Funktionszeiger != NULL)<br />
- die Parameterliste deiner dll-Funktionen stimmt nicht mit der lokalen Funktiondeklaration überein (in dll ein int, lokal zwei int)</p>
<p>Ciao</p>
]]></description><link>https://www.c-plusplus.net/forum/post/834418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/834418</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Tue, 19 Jul 2005 14:19:38 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man DLL verbinden on Wed, 20 Jul 2005 11:36:19 GMT]]></title><description><![CDATA[<p>hallo alle zusammen<br />
ich habe fiertiges Dll unter Delphi und will mit einem programm unter C++<br />
einbenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/835140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/835140</guid><dc:creator><![CDATA[Wa Chan]]></dc:creator><pubDate>Wed, 20 Jul 2005 11:36:19 GMT</pubDate></item></channel></rss>