<?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[Funktion mit Feld auf dll]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe eine h datei in der funktionen für eine dll enthalten sind. Da die lib datei nicht zu borland kompatible ist, habe ich die funktionen dirket aus der dll gezogen.</p>
<p>in der h datei stand folgende Funktion:</p>
<pre><code class="language-cpp">void BPM_Register(int code[10]);
</code></pre>
<p>zum Auslesen aus der dll hab ich daraus folgendes gemacht:</p>
<pre><code class="language-cpp">void BPM_Register(int code[10])
{
   HINSTANCE hInstance;
   typedef void (DLLFUNCTION1)(int);
   DLLFUNCTION1   *pDllFunction1;
   hInstance = ::LoadLibrary(&quot;bpmDetect.dll&quot;);
   pDllFunction1  = (DLLFUNCTION1*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Register&quot;);  // Aufruf aus .def Datei

   if(pDllFunction1)
        (*pDllFunction1)(code[10]);

}
</code></pre>
<p>wenn ich die funktion jetzt aufrufe bekomm ich einen EAccessViolation Fehler.</p>
<p>sieht einer von euch wo der fehler sein könnte??</p>
<p>Ach, der Aufruf sieht so aus:</p>
<pre><code class="language-cpp">int code[10]={10, 10, 10, 10, 10, 10, 10, 10, 10, 10};
BPM_Register(code);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/174567/funktion-mit-feld-auf-dll</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 20:14:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174567.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Feb 2007 17:09:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion mit Feld auf dll on Wed, 28 Feb 2007 17:09:52 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe eine h datei in der funktionen für eine dll enthalten sind. Da die lib datei nicht zu borland kompatible ist, habe ich die funktionen dirket aus der dll gezogen.</p>
<p>in der h datei stand folgende Funktion:</p>
<pre><code class="language-cpp">void BPM_Register(int code[10]);
</code></pre>
<p>zum Auslesen aus der dll hab ich daraus folgendes gemacht:</p>
<pre><code class="language-cpp">void BPM_Register(int code[10])
{
   HINSTANCE hInstance;
   typedef void (DLLFUNCTION1)(int);
   DLLFUNCTION1   *pDllFunction1;
   hInstance = ::LoadLibrary(&quot;bpmDetect.dll&quot;);
   pDllFunction1  = (DLLFUNCTION1*)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Register&quot;);  // Aufruf aus .def Datei

   if(pDllFunction1)
        (*pDllFunction1)(code[10]);

}
</code></pre>
<p>wenn ich die funktion jetzt aufrufe bekomm ich einen EAccessViolation Fehler.</p>
<p>sieht einer von euch wo der fehler sein könnte??</p>
<p>Ach, der Aufruf sieht so aus:</p>
<pre><code class="language-cpp">int code[10]={10, 10, 10, 10, 10, 10, 10, 10, 10, 10};
BPM_Register(code);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1236921</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1236921</guid><dc:creator><![CDATA[JBOpael]]></dc:creator><pubDate>Wed, 28 Feb 2007 17:09:52 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit Feld auf dll on Thu, 01 Mar 2007 13:45:40 GMT]]></title><description><![CDATA[<p>Prüf als erstes nach, ob GetProcAddress einen Nullzeiger zurückliefert. In diesen Fall konnte die funktion in der DLL nicht gefunden werden.</p>
<p>Ev. hilft auch:</p>
<pre><code>extern &quot;C&quot;
{ 
  typedef void (DLLFUNCTION1)(int);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1237468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237468</guid><dc:creator><![CDATA[Burkhi]]></dc:creator><pubDate>Thu, 01 Mar 2007 13:45:40 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit Feld auf dll on Thu, 01 Mar 2007 13:51:45 GMT]]></title><description><![CDATA[<p>JBOpael schrieb:</p>
<blockquote>
<p>Da die lib datei nicht zu borland kompatible ist</p>
</blockquote>
<p>-&gt; coff2omf oder implib verwenden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237473</guid><dc:creator><![CDATA[audacia|off]]></dc:creator><pubDate>Thu, 01 Mar 2007 13:51:45 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit Feld auf dll on Thu, 01 Mar 2007 13:59:07 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Unabhängig davon ob die Funktion in der DLL richtig exportiert wurde und vom Programm richtig importiert werden konnte, wundere ich mich das der gezeigte Code überhaupt kompiliert. Denn spätestens in der letzten Zeile kommt ein Konvertierungsfehler, weil das syntaktisch schon falsch ist.<br />
Hier eine syntaktisch korrigierte Version</p>
<pre><code class="language-cpp">HINSTANCE hInstance;
   typedef void (*DLLFUNCTION1)(int); // Richtige Definition eines Funktionspointertypes
   DLLFUNCTION1   pDllFunction1; // Kein Sternchen notwendig
   hInstance = ::LoadLibrary(&quot;bpmDetect.dll&quot;);
   pDllFunction1  = (DLLFUNCTION1)::GetProcAddress((HMODULE)hInstance, &quot;BPM_Register&quot;);  // Kein Sternchen notwendig

   if(pDllFunction1)
        pDllFunction1(code); // Richtiger Aufruf mit richtigem Argument
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237479</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237479</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 01 Mar 2007 13:59:07 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion mit Feld auf dll on Thu, 01 Mar 2007 14:18:47 GMT]]></title><description><![CDATA[<p>Welche Signatur hat die Funktion in der dll überhaupt?<br />
void BPM_Register(int code[10]);<br />
oder<br />
void BPM_Register(int code);<br />
Weiterhin hattest du hier</p>
<pre><code class="language-cpp">if(pDllFunction1) (*pDllFunction1)(code[10]);
</code></pre>
<p>neben dem von akari schon erwähnten Fehler noch das Problem, dass du auf ein ungültiges Arrayelement zugreifen wolltest. code ist ein int[10], kann also 10 ints enthalten. Mit code[10] willst du aber auf das 11te Element zugreifen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237503</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 01 Mar 2007 14:18:47 GMT</pubDate></item></channel></rss>