<?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[Zugriffsverletzung nach einbinden von dll]]></title><description><![CDATA[<p>Hi,<br />
Da ich es nicht hinbekommen hab die lib datei in borland zum laufen zu bekommen, hab ich jetzt mal versucht die dll direkt einzubinden.<br />
Infos dafür hab ich mir aus den FAQ geholt. das sieht im moment bei mir so aus:</p>
<pre><code class="language-cpp">//h Datei

class BPMDetection
{
private:
   typedef int (DLLFUNCTION1)(void);
   typedef void (DLLFUNCTION2)(int);
   typedef double (DLLFUNCTION3)(int,int);

   DLLFUNCTION1   *pDllFunction1;
   DLLFUNCTION2   *pDllFunction2;
   DLLFUNCTION3   *pDllFunction3;

public:
    BPMDetection();
    int BPM_Create(void);
    void BPM_Destroy(int bpm);
    double BPM_getParameter(int bpm,int param);
};

//cpp Datei

BPMDetection::BPMDetection()
{
   HINSTANCE hInstance;

   hInstance = ::LoadLibrary(&quot;bpmDetect.dll&quot;);
   pDllFunction1  = (DLLFUNCTION1*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Create&quot;);
   pDllFunction2  = (DLLFUNCTION2*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Destroy&quot;);
   pDllFunction3  = (DLLFUNCTION3*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_getParameter&quot;);
}

int BPMDetection::BPM_Create(void)
{
    int iResult;

    if (pDllFunction1)
        iResult = (*pDllFunction1)();

}

void BPMDetection::BPM_Destroy(int bpm)
{
   // void iResult;

    if (pDllFunction2)
        (*pDllFunction2)(bpm);

}

double BPMDetection::BPM_getParameter(int bpm,int param)
{
    double iResult;

    if (pDllFunction3)
       iResult =(*pDllFunction3)(bpm,param);
}
</code></pre>
<p>Wenn ich jetzt die funktion BPM_Create() aufrufe, funkioniert das auch. ich bekomme einen Wert zurück und alles ist supi. Aber wenn ich jetzt die Funktion BPM_getParameter aufrufe, kommt &quot;Zugriffsverletzung bei Adresse [..] . Schreiben von Adresse [...].&quot; Der fehler weist doch normalerweise auf nen Zeigerfehler hin, aber ich seh da nicht wirklich einen zusammenhang.</p>
<p>Kann mir villeicht jemand sagen ob da ein fehler drin ist, oder wodran das liegen könnte??</p>
<p>Danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/164900/zugriffsverletzung-nach-einbinden-von-dll</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 14:16:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/164900.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Nov 2006 17:54:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zugriffsverletzung nach einbinden von dll on Mon, 13 Nov 2006 17:54:23 GMT]]></title><description><![CDATA[<p>Hi,<br />
Da ich es nicht hinbekommen hab die lib datei in borland zum laufen zu bekommen, hab ich jetzt mal versucht die dll direkt einzubinden.<br />
Infos dafür hab ich mir aus den FAQ geholt. das sieht im moment bei mir so aus:</p>
<pre><code class="language-cpp">//h Datei

class BPMDetection
{
private:
   typedef int (DLLFUNCTION1)(void);
   typedef void (DLLFUNCTION2)(int);
   typedef double (DLLFUNCTION3)(int,int);

   DLLFUNCTION1   *pDllFunction1;
   DLLFUNCTION2   *pDllFunction2;
   DLLFUNCTION3   *pDllFunction3;

public:
    BPMDetection();
    int BPM_Create(void);
    void BPM_Destroy(int bpm);
    double BPM_getParameter(int bpm,int param);
};

//cpp Datei

BPMDetection::BPMDetection()
{
   HINSTANCE hInstance;

   hInstance = ::LoadLibrary(&quot;bpmDetect.dll&quot;);
   pDllFunction1  = (DLLFUNCTION1*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Create&quot;);
   pDllFunction2  = (DLLFUNCTION2*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Destroy&quot;);
   pDllFunction3  = (DLLFUNCTION3*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_getParameter&quot;);
}

int BPMDetection::BPM_Create(void)
{
    int iResult;

    if (pDllFunction1)
        iResult = (*pDllFunction1)();

}

void BPMDetection::BPM_Destroy(int bpm)
{
   // void iResult;

    if (pDllFunction2)
        (*pDllFunction2)(bpm);

}

double BPMDetection::BPM_getParameter(int bpm,int param)
{
    double iResult;

    if (pDllFunction3)
       iResult =(*pDllFunction3)(bpm,param);
}
</code></pre>
<p>Wenn ich jetzt die funktion BPM_Create() aufrufe, funkioniert das auch. ich bekomme einen Wert zurück und alles ist supi. Aber wenn ich jetzt die Funktion BPM_getParameter aufrufe, kommt &quot;Zugriffsverletzung bei Adresse [..] . Schreiben von Adresse [...].&quot; Der fehler weist doch normalerweise auf nen Zeigerfehler hin, aber ich seh da nicht wirklich einen zusammenhang.</p>
<p>Kann mir villeicht jemand sagen ob da ein fehler drin ist, oder wodran das liegen könnte??</p>
<p>Danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1173859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1173859</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Mon, 13 Nov 2006 17:54:23 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung nach einbinden von dll on Tue, 14 Nov 2006 14:55:31 GMT]]></title><description><![CDATA[<p>Es gibt da 2 Möglichkeiten:</p>
<p>1. Die Funktion wurde in der DLL nicht gefunden. Dann enthält pDllFunction3 eine 0.<br />
2. Die Funktion in der DLL verursacht diese Fehlermeldung.</p>
<p>Edit: Sowie ich das sehe, kommt Möglichkeit 2 in Betracht, denn du fängst einen Nullzeiger ja schon ab <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1174577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1174577</guid><dc:creator><![CDATA[Burkhi]]></dc:creator><pubDate>Tue, 14 Nov 2006 14:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung nach einbinden von dll on Wed, 15 Nov 2006 07:09:35 GMT]]></title><description><![CDATA[<p>Danke für die antwort!</p>
<p>Gibt es den ne möglichkeit herausfinde warum die funktion in der dll einen fehler macht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1174872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1174872</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 15 Nov 2006 07:09:35 GMT</pubDate></item><item><title><![CDATA[Reply to Zugriffsverletzung nach einbinden von dll on Wed, 15 Nov 2006 08:13:56 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Grundsätzlich mit dem Debugger.<br />
Wobei du aber erstmal überprüfen solltest, ob du wirklich richtige Funktionsprototypen castest, und ob du wirklich die richtigen Parameter übergibst.<br />
Vielleicht brauchst du auch eine andere vorbereitende Funktion zwischen Create und GetParameter?<br />
Jedenfalls läßt sich für uns hier nur aufgrund des geposteten Codes kein Fehler finden. Schau lieber in die Doku der Library.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1174919</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1174919</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 15 Nov 2006 08:13:56 GMT</pubDate></item></channel></rss>