<?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 Funktionsproblem]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab folgendes Problem:<br />
ich soll eine DLL einbinden und mit Hilfe einer Funktion aus dieser DLL eine Hardware abfragen.<br />
Die DLL konnt ich erfolgreich einbinden, und eine Funktion die mir bei der Abfrage der Hardware helfen könnte habe ich auch schon gefunden.<br />
Nur wenn ich auf diese zugreifen will, dann kommt immer die Fehlermeldung<br />
&quot;raised exception class EAccessViolation with message 'Die Anwendung ist für diese Funktion nicht lizenziert'&quot;.<br />
Diese macht aber wenig sinn denn der Hardwareherrsteller hat diese selbst zur Verfügung gestellt.<br />
Vielleicht habt ihr ne Ahnung was ich verkehrt gemacht hab.<br />
hier mein kleines testprogramm<br />
.h</p>
<pre><code>#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;FileCtrl.hpp&gt;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TButton *Button1;
        TButton *Button2;
        TButton *Button3;
        TLabel *Label1;
        TEdit *Edit1;
        TEdit *Edit2;

void __fastcall Button1Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
private:	// User declarations
    HINSTANCE DllInstance; // Instanz auf die DLL deklarieren
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>.cpp</p>
<pre><code>#include &lt;vcl.h&gt;
#pragma hdrstop
#include &quot;windows.h&quot;
#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    if (!DllInstance) DllInstance = LoadLibrary(&quot;CubeAV.dll&quot;); // DLL laden

    if (DllInstance) Form1-&gt;Caption = &quot;CubeAV.dll wurde geladen.&quot;;
}

void __fastcall TForm1::Button3Click(TObject *Sender)
{
    if (DllInstance)
       if (FreeLibrary(DllInstance)) DllInstance = NULL; // DLL entladen

    if (!DllInstance) Form1-&gt;Caption = &quot;CubeAV.dll nicht geladen.&quot;;
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
    // Funktionstyp deklarieren
    typedef unsigned char (__stdcall *IMPFUNC) (void);//???

    // Deklaration für die DLL-Funktion
    IMPFUNC DllFunktion;
    char cStatus;
    unsigned char *ComCode;
    ComCode =&quot;A0006280&quot;;
    if (DllInstance)
    {
        //DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;Addiere&quot;);
        DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;?GetCurrentMode@CCubeAV@@QAEEXZ&quot;);

        if (DllFunktion)
        {
            // DLL-Funktion aufrufen,
            cStatus = DllFunktion();

            Label1-&gt;Caption = cStatus;
            Form1-&gt;Caption = &quot;Funktionsname existiert!&quot;;
        }
        else Form1-&gt;Caption = &quot;Funktionsname existiert nicht!&quot;;
    }
    else
    {
        Label1-&gt;Caption = &quot;Bitte DLL laden!&quot;;
    }
}
</code></pre>
<p>&quot;?GetCurrentMode@CCubeAV@@QAEEXZ&quot; steht für<br />
&quot;unsigned char CCubeAV::GetCurrentMode(void)&quot;<br />
(hab ich mit Dependency Walker rausgefunden)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/82334/dll-funktionsproblem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 10:35:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/82334.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Aug 2004 12:36:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL Funktionsproblem on Tue, 10 Aug 2004 12:36:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab folgendes Problem:<br />
ich soll eine DLL einbinden und mit Hilfe einer Funktion aus dieser DLL eine Hardware abfragen.<br />
Die DLL konnt ich erfolgreich einbinden, und eine Funktion die mir bei der Abfrage der Hardware helfen könnte habe ich auch schon gefunden.<br />
Nur wenn ich auf diese zugreifen will, dann kommt immer die Fehlermeldung<br />
&quot;raised exception class EAccessViolation with message 'Die Anwendung ist für diese Funktion nicht lizenziert'&quot;.<br />
Diese macht aber wenig sinn denn der Hardwareherrsteller hat diese selbst zur Verfügung gestellt.<br />
Vielleicht habt ihr ne Ahnung was ich verkehrt gemacht hab.<br />
hier mein kleines testprogramm<br />
.h</p>
<pre><code>#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &lt;FileCtrl.hpp&gt;
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TButton *Button1;
        TButton *Button2;
        TButton *Button3;
        TLabel *Label1;
        TEdit *Edit1;
        TEdit *Edit2;

void __fastcall Button1Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
private:	// User declarations
    HINSTANCE DllInstance; // Instanz auf die DLL deklarieren
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>.cpp</p>
<pre><code>#include &lt;vcl.h&gt;
#pragma hdrstop
#include &quot;windows.h&quot;
#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    if (!DllInstance) DllInstance = LoadLibrary(&quot;CubeAV.dll&quot;); // DLL laden

    if (DllInstance) Form1-&gt;Caption = &quot;CubeAV.dll wurde geladen.&quot;;
}

void __fastcall TForm1::Button3Click(TObject *Sender)
{
    if (DllInstance)
       if (FreeLibrary(DllInstance)) DllInstance = NULL; // DLL entladen

    if (!DllInstance) Form1-&gt;Caption = &quot;CubeAV.dll nicht geladen.&quot;;
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
    // Funktionstyp deklarieren
    typedef unsigned char (__stdcall *IMPFUNC) (void);//???

    // Deklaration für die DLL-Funktion
    IMPFUNC DllFunktion;
    char cStatus;
    unsigned char *ComCode;
    ComCode =&quot;A0006280&quot;;
    if (DllInstance)
    {
        //DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;Addiere&quot;);
        DllFunktion = (IMPFUNC)GetProcAddress(DllInstance, &quot;?GetCurrentMode@CCubeAV@@QAEEXZ&quot;);

        if (DllFunktion)
        {
            // DLL-Funktion aufrufen,
            cStatus = DllFunktion();

            Label1-&gt;Caption = cStatus;
            Form1-&gt;Caption = &quot;Funktionsname existiert!&quot;;
        }
        else Form1-&gt;Caption = &quot;Funktionsname existiert nicht!&quot;;
    }
    else
    {
        Label1-&gt;Caption = &quot;Bitte DLL laden!&quot;;
    }
}
</code></pre>
<p>&quot;?GetCurrentMode@CCubeAV@@QAEEXZ&quot; steht für<br />
&quot;unsigned char CCubeAV::GetCurrentMode(void)&quot;<br />
(hab ich mit Dependency Walker rausgefunden)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/578988</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/578988</guid><dc:creator><![CDATA[CS]]></dc:creator><pubDate>Tue, 10 Aug 2004 12:36:56 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Tue, 10 Aug 2004 12:55:21 GMT]]></title><description><![CDATA[<p>Hast oder hattest du zuvor oder parallel eine andere BCB-Version installiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/578998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/578998</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Tue, 10 Aug 2004 12:55:21 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Tue, 10 Aug 2004 13:22:14 GMT]]></title><description><![CDATA[<p>hatte davor version 5 drauf, aber da ich sie unter xp net zum laufen gebracht hatte ist version 6 gekommen.</p>
<p>noch ein nachtrag zu der ausgewählten funktion:<br />
die &quot;?GetCurrentMode@CCubeAV@@QAEEXZ&quot; die ich bräuchte gibt die<br />
besagte fehlermeldung aber diese Funktion geht<br />
&quot;?NotifyCurrentMode@CCubeAV@@QAEXH@Z&quot;<br />
ohne fehlermeldung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/579028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/579028</guid><dc:creator><![CDATA[CS]]></dc:creator><pubDate>Tue, 10 Aug 2004 13:22:14 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Tue, 10 Aug 2004 17:12:24 GMT]]></title><description><![CDATA[<p>CS schrieb:</p>
<blockquote>
<p>hatte davor version 5 drauf</p>
</blockquote>
<p>Das ist eine potentielle Ursache für das Problem. Um das auszuschliessen müsstest du den BCB6 komplett de- und dann neuinstallieren, einschliesslich der ggf. manuellen Entfernung sämtlich verbliebener BCB5- und/oder BCB6-Dateien und aller Borland-bezogenen Registry-Einträge.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/579226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/579226</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Tue, 10 Aug 2004 17:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Fri, 15 Apr 2005 08:40:01 GMT]]></title><description><![CDATA[<p>hi there,</p>
<p>sach mal &quot;cubeAV.dll&quot; hört sich für mich nach dem AOpen EA65 AV Cube an. hast Du den Auftrag von AOpen bekommen, dies zu tun?</p>
<p>mfg,</p>
<p>stonie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/767307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/767307</guid><dc:creator><![CDATA[stonie]]></dc:creator><pubDate>Fri, 15 Apr 2005 08:40:01 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Fri, 15 Apr 2005 09:02:03 GMT]]></title><description><![CDATA[<p>Sach mal, wieso gräbst du so nen alten Thread aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/767335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/767335</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Fri, 15 Apr 2005 09:02:03 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Fri, 15 Apr 2005 09:08:23 GMT]]></title><description><![CDATA[<p>Und vor allem: Wie hast du den ohne Suchfunktion überhaupt gefunden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/767341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/767341</guid><dc:creator><![CDATA[HEZ]]></dc:creator><pubDate>Fri, 15 Apr 2005 09:08:23 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Fri, 15 Apr 2005 09:33:53 GMT]]></title><description><![CDATA[<p>Das Forum lässt sich zum Grossteil auch noch durchsuchen, wenn man unter <a href="http://www.google.ch" rel="nofollow">www.google.ch</a> hingeht und als Suchwort &quot;site:c-plusplus.net&quot; zur restlichen Abfrage hinzufügt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/767360</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/767360</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Fri, 15 Apr 2005 09:33:53 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Funktionsproblem on Fri, 15 Apr 2005 09:37:07 GMT]]></title><description><![CDATA[<p>HEZ schrieb:</p>
<blockquote>
<p>Und vor allem: Wie hast du den ohne Suchfunktion überhaupt gefunden?</p>
</blockquote>
<p>HEZ, denk mal nicht 2dimensional.. <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="😃"
    /><br />
geh mal auf <a href="http://www.google.de" rel="nofollow">www.google.de</a> und gib das als suche ein:</p>
<p>Googlesuche schrieb:</p>
<blockquote>
<p>site:www.c-plusplus.net DLL Funktionsproblem</p>
</blockquote>
<p><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="🤡"
    /></p>
<p>[edit] och zu spät... <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="😞"
    /> [/edit]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/767361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/767361</guid><dc:creator><![CDATA[BigNeal]]></dc:creator><pubDate>Fri, 15 Apr 2005 09:37:07 GMT</pubDate></item></channel></rss>