<?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[Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden)]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte mal testen eine Anwendung zu schreiben, die ich mit PlugIns<br />
erweitern kann.</p>
<p>Ich hab leider keine Idee wie ich anfangen könnte. Programmiert hab ich<br />
schon viel mit dem Borland Builder 6, aber hier steh ich echt auf dem<br />
Schlauch.</p>
<p>Das Plugin sollte mir z.B. in einer MDI-Form ein neues Fenster mit einem<br />
Knopf erstellen. Hat jemand ein solches Beispiel / Tutorial dafür oder<br />
kann mir einen Rat geben womit ich anfangen kann?</p>
<p>Vielen Dank schonmal!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/79042/plugins-support-nur-wie-tfont-kann-nicht-zu-tfont-zugewiesen-werden</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 11:00:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/79042.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Jul 2004 13:46:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Thu, 08 Jul 2004 12:52:35 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte mal testen eine Anwendung zu schreiben, die ich mit PlugIns<br />
erweitern kann.</p>
<p>Ich hab leider keine Idee wie ich anfangen könnte. Programmiert hab ich<br />
schon viel mit dem Borland Builder 6, aber hier steh ich echt auf dem<br />
Schlauch.</p>
<p>Das Plugin sollte mir z.B. in einer MDI-Form ein neues Fenster mit einem<br />
Knopf erstellen. Hat jemand ein solches Beispiel / Tutorial dafür oder<br />
kann mir einen Rat geben womit ich anfangen kann?</p>
<p>Vielen Dank schonmal!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/555254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/555254</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Thu, 08 Jul 2004 12:52:35 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Thu, 08 Jul 2004 12:41:34 GMT]]></title><description><![CDATA[<p>also der akutelle Status sieht so aus:</p>
<p>So wie ich das sehe ist das ganze nur per dll's machbar, also hab ich das hier<br />
versucht:</p>
<p>In dem Projekt:</p>
<pre><code class="language-cpp">typedef void TDoNothing(TPanel *);
void DoNothing(TPanel * MyPanel);

void DoNothing(TPanel * MyPanel)
{
    TDoNothing* DoNothing; 
    HINSTANCE h = LoadLibrary(&quot;Project2.dll&quot;); 

    if (h != 0) {
        DoNothing = (TDoNothing*)GetProcAddress(h, &quot;_DoNothing&quot;);
        if (SubVals != NULL) {
        	DoNothing(MyPanel);
        }
        FreeLibrary(h); //DLL freigeben.
    }
}
</code></pre>
<p>und in der dll:</p>
<pre><code class="language-cpp">extern &quot;C&quot; __declspec(dllexport) void DoNothing(TPanel *MyPanel)
{
    MyPanel-&gt;Caption = &quot;hallo&quot;; // &lt;- das hier klappt noch

    TButton * NewButton = new TButton(MyPanel);
    NewButton-&gt;Parent = MyPanel;
    NewButton-&gt;Caption = &quot;hurrai&quot;;
}
</code></pre>
<p>leider kommt dann eine sehr merkwürdige Fehlermeldung:<br />
&quot;TFont kann nicht zu TFont zugewiesen werden&quot;.</p>
<p>Wie kann ich auf dem Panel wirklich einen neuen Knopf und andere Steuerelemente<br />
anlegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/556024</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/556024</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Thu, 08 Jul 2004 12:41:34 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Sat, 10 Jul 2004 11:34:19 GMT]]></title><description><![CDATA[<p>hat sowas wirklich noch keiner gemacht? Ich finde echt nichts über PlugIn<br />
Programmierung mit dem BCB 6 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/557391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557391</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Sat, 10 Jul 2004 11:34:19 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Sat, 10 Jul 2004 15:30:59 GMT]]></title><description><![CDATA[<p>Schau dir mal das hier an:</p>
<p><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></p>
<p>Hab' damit auch meine ersten DLL's programmiert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557570</guid><dc:creator><![CDATA[Dasd]]></dc:creator><pubDate>Sat, 10 Jul 2004 15:30:59 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Mon, 12 Jul 2004 16:52:29 GMT]]></title><description><![CDATA[<p>inzwischen funktioniert es <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="🙂"
    /> <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="🙂"
    /> <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>wenn Interesse besteht kann ich auch mal ein kleines Beispiel machen<br />
wie man PlugIn's für seine eigenen Programme schreibt und verwendet.<br />
Ist eigentlich recht einfach.</p>
<p>Danke für den Link Dasd</p>
]]></description><link>https://www.c-plusplus.net/forum/post/559057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/559057</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Mon, 12 Jul 2004 16:52:29 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Mon, 13 Dec 2004 08:33:52 GMT]]></title><description><![CDATA[<p><strong>PluginHeader.h</strong></p>
<p>Hier ist die Deklaration der Plugin Schnittstelle. Diese sollten alle<br />
Plugin Entwickler kennen. Und diese muss auch in jedes Plugin included<br />
werden.</p>
<pre><code class="language-cpp">#include &lt;vcl.h&gt;

class myPlugIn: public TObject
{
public:
    virtual void Execute(int a, int b) = 0;
    virtual bool ReadBytes(int iBytes, char * cData) = 0;
};
</code></pre>
<p><strong>CPlugins.h</strong></p>
<p>CPlugins.h und CPlugins.cpp sind ein kleiner Bonus. Diese Klasse<br />
handelt mehrere Plugins und erstellt entsprechende Menüs im Hauptprogramm.</p>
<pre><code class="language-cpp">#include &lt;vcl.h&gt;
#include &quot;PluginHeader.h&quot;
typedef struct TFiledata
{
  String Name;
  String Path;
  TSearchRec Data;
}tFiledata;

typedef tFiledata* pFiledata;

class CPlugins {
    private:
        void __fastcall CPlugins::GetPluginList(TList*Liste, String StartDirectory, String Extention);
    public:
        __fastcall CPlugins::CPlugins();
        void __fastcall ShowPlugins(TMenuItem * MenuItem);
        void __fastcall CPlugins::StartPlugin(AnsiString PluginName);
};
</code></pre>
<p><strong>Cplugins.cpp</strong></p>
<pre><code class="language-cpp">#include &quot;CPlugins.h&quot;
#include &quot;PluginHeader.h&quot;

void __fastcall CPlugins::ShowPlugins(TMenuItem * MenuItem) 
{ 
    TList*FileList = new TList; 
    GetPluginList(FileList, &quot;Plugins\\&quot;, &quot;*.dll&quot;); 

    pFiledata Item; 
    for(int i = 0; i &lt; FileList-&gt;Count; i++) { 
        Application-&gt;ProcessMessages(); 
        Item = (pFiledata)FileList-&gt;Items[i]; 

        TMenuItem *newMenuItem = new TMenuItem(MenuItem); 
        newMenuItem-&gt;Caption = Item-&gt;Name.SubString(1, Item-&gt;Name.Length() - 4); 
        MenuItem-&gt;Add(newMenuItem); 
        delete Item; 
    } 

    delete FileList; 
} 

void __fastcall CPlugins::GetPluginList(TList*Liste, String StartDirectory, String Extention) 
{ 
    TSearchRec sr; 
    String Directory; 
    int result = FindFirst((StartDirectory + Extention).c_str(), faReadOnly|faHidden|faDirectory, sr ); 

    while(result == 0) { 
        Application-&gt;ProcessMessages(); 

        if((sr.Attr &amp; faDirectory)) { // ist ein Verzeichnis 
        } else {  // ist normale Datei 
            pFiledata Item = new tFiledata; 
            Item-&gt;Name = sr.Name; 
            Item-&gt;Path = StartDirectory; 
            Item-&gt;Data = sr; 
            Liste-&gt;Add(Item); 
        } 
        result=FindNext(sr); 
    } 
    FindClose(sr); 
} 

void __fastcall CPlugins::StartPlugin(AnsiString PluginName) 
{ 
    typedef myPlugIn* TCreatePluginObject(void);
    TCreatePluginObject* CreatePlugInObject;

    PluginName = &quot;Plugins\\&quot; + PluginName; 

    HINSTANCE h = LoadLibrary(PluginName.c_str()); //DLL laden. 
    myPlugIn* MyPlugin;
    if (h != 0) { 
        CreatePlugInObject = (TCreatePluginObject*)GetProcAddress(h, &quot;@CreatePlugInObject$qv&quot;); 
    } else { 
        ShowMessage(&quot;DLL Not found&quot;); 
        return; 
    } 
    if (CreatePlugInObject != NULL) { 
        MyPlugin = CreatePlugInObject(); 
    } else { 
        ShowMessage(&quot;Objekt not created&quot;); 
        return; 
    } 

    // DLL ist nun geladen und kann verwendet werden. 

    MyPlugin-&gt;Execute(1, 2); 

    // irgendwann auch wieder löschen. 
    delete MyPlugin; 
}
</code></pre>
<p><strong>Beispiel Plugin, myPlugin.cpp</strong><br />
Wird erstellt über Datei / neu / weiter -&gt; DLL Experte</p>
<pre><code class="language-cpp">#include &lt;vcl.h&gt;
#include &lt;windows.h&gt;
#pragma hdrstop
#include &quot;PluginHeader.h&quot;

#pragma argsused

class CTestPlugin: public myPlugIn
{
__published:
private:
public:
    void Execute(int a, int b);
    bool ReadBytes(int iBytes, char * cData);
};

void CTestPlugin::Execute(int a, int b)
{
    ShowMessage(a);
    ShowMessage(b);
}

bool CTestPlugin::ReadBytes(int iBytes, char * cData)
{
     return false;
}

__declspec(dllexport) myPlugIn* CreatePlugInObject()
{
    return new CTestPlugin;
}

int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
    return 1;
}
</code></pre>
<p>das war auch schon alles <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="😉"
    /> viel Spaß beim programmieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/626568</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/626568</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Mon, 13 Dec 2004 08:33:52 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Wed, 13 Oct 2004 10:03:34 GMT]]></title><description><![CDATA[<p>Habe etwas aufgeräumt und die &quot;Push&quot;-Beiträge gelöscht.</p>
<p>Es wäre nett, wenn mal jemand das Beispiel nachvollzieht bzw. eine Rückmeldung gibt, so dass eventuelle Fragen oder Verbesserungsvorschläge diskutiert werden können, bevor der Thread in die FAQ kommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/627501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/627501</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 13 Oct 2004 10:03:34 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Sun, 28 Nov 2004 12:01:59 GMT]]></title><description><![CDATA[<p>Ich möchte das mit den PlugIns jetzt auch mal ausprobieren und damit herumtesten.<br />
Aber er sagt mir in der Cplugins.cpp immer Undefiniertes Symbol 'pFiledata'. Was habe ich vergessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/661000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/661000</guid><dc:creator><![CDATA[pug]]></dc:creator><pubDate>Sun, 28 Nov 2004 12:01:59 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Tue, 30 Nov 2004 04:20:15 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/8106">@pug</a> habs hinzugefügt. Hatte die Deklaration vergessen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/662436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/662436</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Tue, 30 Nov 2004 04:20:15 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Fri, 03 Dec 2004 19:01:29 GMT]]></title><description><![CDATA[<p>Irgendwie habe ich auch noch ein Problem mit dieser Zeile.</p>
<pre><code class="language-cpp">typedef SPCGFXPlugIn* TCreatePluginObject(void);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/665422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/665422</guid><dc:creator><![CDATA[pug]]></dc:creator><pubDate>Fri, 03 Dec 2004 19:01:29 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Sun, 12 Dec 2004 18:34:09 GMT]]></title><description><![CDATA[<p>*schieb*</p>
<p>Gibt immer noch den Fehler Undefiniertes Symbol 'TCreatePluginObject'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/671795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/671795</guid><dc:creator><![CDATA[pug]]></dc:creator><pubDate>Sun, 12 Dec 2004 18:34:09 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Mon, 13 Dec 2004 08:35:13 GMT]]></title><description><![CDATA[<p>versuch es jetzt nochmal. Müsste nun gehen. Ich hatte einen Klassennamen anders<br />
benannt wie bei mir.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/672070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/672070</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Mon, 13 Dec 2004 08:35:13 GMT</pubDate></item><item><title><![CDATA[Reply to Plugins Support - nur wie? (TFont kann nicht zu TFont zugewiesen werden) on Tue, 14 Dec 2004 15:12:39 GMT]]></title><description><![CDATA[<p>Vielen Dank. So funktioniert alles.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/673091</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/673091</guid><dc:creator><![CDATA[pug]]></dc:creator><pubDate>Tue, 14 Dec 2004 15:12:39 GMT</pubDate></item></channel></rss>