<?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[Fehler in der Deklaration Source Code]]></title><description><![CDATA[<p>Hi,</p>
<p>habe folgendes kleines Problem.</p>
<pre><code class="language-cpp">//..Deklaration..//
int (__cdecl * ScopeSetAmpScale) (int ScopeHandle, int BeamNum, double AmpScale); 

...
ScopeSetAmpScale = (int (__cdecl  * )(int, struct tagTArrDbl *))GetProcAddress(DllInst, &quot;ScopeSetAmpScale&quot;); 
   if (ScopeSetAmpScale == NULL) 
   { FreeLibrary(DllInst); MessageBox(&quot;Error DLL loading 9&quot;,&quot;Error&quot;,MB_ICONSTOP); 
   exit(-1); 
   }
</code></pre>
<p>Mein Kompiler meldet als Fehler<br />
error C2440: '=': 'int (__cdecl *)(int,tagTArrDbl *)' kann nicht in 'int (__cdecl *)(int,int,double)' konvertiert werden<br />
Diese Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat</p>
<p>Ich habe aber alles nach Herstellerangaben deklariert. Leider weiß ich nicht mehr weiter. Vielleicht kann einer von euch den Fehler in der Deklaration sehen.</p>
<pre><code class="language-cpp">//..Deklaration..
int (__cdecl  *     ScopeShowNext)    (int Prm, struct  tagTArrDbl *PrmD );
...

  ScopeShowNext  = (int (__cdecl  * )(int, struct tagTArrDbl *))GetProcAddress(DllInst, &quot;ShowNext&quot;);
   if (ScopeShowNext == NULL) 
   { FreeLibrary(DllInst); MessageBox(&quot;Error DLL loading 3&quot;,&quot;Error&quot;,MB_ICONSTOP); 
     exit(-1);  
   }
</code></pre>
<p>Diese Deklaration klappt ohne Probleme und soll laut Hersteller genau gleich sein.</p>
<p>Versuche damit ein externes Oszilloskop anzusteuern</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/209867/fehler-in-der-deklaration-source-code</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 02:22:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/209867.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Apr 2008 08:53:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler in der Deklaration Source Code on Fri, 04 Apr 2008 08:53:45 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>habe folgendes kleines Problem.</p>
<pre><code class="language-cpp">//..Deklaration..//
int (__cdecl * ScopeSetAmpScale) (int ScopeHandle, int BeamNum, double AmpScale); 

...
ScopeSetAmpScale = (int (__cdecl  * )(int, struct tagTArrDbl *))GetProcAddress(DllInst, &quot;ScopeSetAmpScale&quot;); 
   if (ScopeSetAmpScale == NULL) 
   { FreeLibrary(DllInst); MessageBox(&quot;Error DLL loading 9&quot;,&quot;Error&quot;,MB_ICONSTOP); 
   exit(-1); 
   }
</code></pre>
<p>Mein Kompiler meldet als Fehler<br />
error C2440: '=': 'int (__cdecl *)(int,tagTArrDbl *)' kann nicht in 'int (__cdecl *)(int,int,double)' konvertiert werden<br />
Diese Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat</p>
<p>Ich habe aber alles nach Herstellerangaben deklariert. Leider weiß ich nicht mehr weiter. Vielleicht kann einer von euch den Fehler in der Deklaration sehen.</p>
<pre><code class="language-cpp">//..Deklaration..
int (__cdecl  *     ScopeShowNext)    (int Prm, struct  tagTArrDbl *PrmD );
...

  ScopeShowNext  = (int (__cdecl  * )(int, struct tagTArrDbl *))GetProcAddress(DllInst, &quot;ShowNext&quot;);
   if (ScopeShowNext == NULL) 
   { FreeLibrary(DllInst); MessageBox(&quot;Error DLL loading 3&quot;,&quot;Error&quot;,MB_ICONSTOP); 
     exit(-1);  
   }
</code></pre>
<p>Diese Deklaration klappt ohne Probleme und soll laut Hersteller genau gleich sein.</p>
<p>Versuche damit ein externes Oszilloskop anzusteuern</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1486270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1486270</guid><dc:creator><![CDATA[Jimbo]]></dc:creator><pubDate>Fri, 04 Apr 2008 08:53:45 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Deklaration Source Code on Fri, 04 Apr 2008 09:09:44 GMT]]></title><description><![CDATA[<p>Der cast in der ersten Version stimmt nicht.<br />
Besser so</p>
<pre><code class="language-cpp">//..Deklaration..//
int (__cdecl * ScopeSetAmpScale) (int ScopeHandle, int BeamNum, double AmpScale);

...
ScopeSetAmpScale = (int (__cdecl  * )(int, int, double))GetProcAddress(DllInst, &quot;ScopeSetAmpScale&quot;);
   if (ScopeSetAmpScale == NULL)
   { FreeLibrary(DllInst); MessageBox(&quot;Error DLL loading 9&quot;,&quot;Error&quot;,MB_ICONSTOP);
   exit(-1);
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1486279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1486279</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 04 Apr 2008 09:09:44 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Deklaration Source Code on Fri, 04 Apr 2008 09:56:31 GMT]]></title><description><![CDATA[<p>Super, danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1486322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1486322</guid><dc:creator><![CDATA[Jimbo]]></dc:creator><pubDate>Fri, 04 Apr 2008 09:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Deklaration Source Code on Fri, 04 Apr 2008 16:47:34 GMT]]></title><description><![CDATA[<p>Übersichtlicher und weniger fehleranfällig wäre ein typedef...</p>
<pre><code class="language-cpp">typedef int (__cdecl * Func) (int ScopeHandle, int BeamNum, double AmpScale);

Func ScopeSetAmpScale;

ScopeSetAmpScale = (Func)GetProcAddress(DllInst, &quot;ScopeSetAmpScale&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1486624</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1486624</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Fri, 04 Apr 2008 16:47:34 GMT</pubDate></item></channel></rss>