<?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 _stdcall Stress. :-(]]></title><description><![CDATA[<p>Hallo Kollegen,</p>
<p>ich versuche eine .dll (mit Borland 6 erstellt) in .NET und Borland zu verwenden. Zu diesem Zweck habe ich eine .h Datei erstellt welche unter beiden Umgebungen das dynamische Einbinden der DLL bewerkstelligt.</p>
<p>Problem:<br />
Beim Borland Compiler muss ich vor jeder Funktion __stdcall schreiben, sonst &quot;Access violation....0x00...&quot;<br />
Bei .NET darf ich nicht __stdcall schreiben, sonst &quot;Error C2059, syntax error...usw...&quot;</p>
<p>Wie muss das DLL Interface exportiert werden damit ich es mit einem Header in versch. Umgebungen einbinden kann.<br />
Oder, wie muss die DLL Importiert werden damit ich ein Header file für versch. Umgebungen nutzen kann?</p>
<p>Schnittstellen EXPORT der DLL:</p>
<pre><code class="language-cpp">#define EXPORT extern &quot;C&quot; __declspec(dllexport)
#define VERSION 1.0

EXPORT double _stdcall GetDllVersion(void){return VERSION;}
</code></pre>
<p>IMPORT:</p>
<pre><code class="language-cpp">#define IMPORT typedef __declspec(dllimport)

IMPORT double (*GET_VERSION)();
GET_VERSION GetDllVersion;

HINSTANCE hDll;
  hDll = LoadLibrary(&quot;Encoder.dll&quot;); //
  if(hDll == NULL){
    ShowMessage(&quot;Unable to load Encoder.dll&quot;);
  }else{
	GetDllVersion = (GET_VERSION)GetProcAddress(hDll,&quot;GetDllVersion&quot;);
  }
</code></pre>
<p>DANKE</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/130056/dll-_stdcall-stress</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 20:48:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/130056.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Dec 2005 11:54:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL _stdcall Stress. :-( on Mon, 19 Dec 2005 11:54:46 GMT]]></title><description><![CDATA[<p>Hallo Kollegen,</p>
<p>ich versuche eine .dll (mit Borland 6 erstellt) in .NET und Borland zu verwenden. Zu diesem Zweck habe ich eine .h Datei erstellt welche unter beiden Umgebungen das dynamische Einbinden der DLL bewerkstelligt.</p>
<p>Problem:<br />
Beim Borland Compiler muss ich vor jeder Funktion __stdcall schreiben, sonst &quot;Access violation....0x00...&quot;<br />
Bei .NET darf ich nicht __stdcall schreiben, sonst &quot;Error C2059, syntax error...usw...&quot;</p>
<p>Wie muss das DLL Interface exportiert werden damit ich es mit einem Header in versch. Umgebungen einbinden kann.<br />
Oder, wie muss die DLL Importiert werden damit ich ein Header file für versch. Umgebungen nutzen kann?</p>
<p>Schnittstellen EXPORT der DLL:</p>
<pre><code class="language-cpp">#define EXPORT extern &quot;C&quot; __declspec(dllexport)
#define VERSION 1.0

EXPORT double _stdcall GetDllVersion(void){return VERSION;}
</code></pre>
<p>IMPORT:</p>
<pre><code class="language-cpp">#define IMPORT typedef __declspec(dllimport)

IMPORT double (*GET_VERSION)();
GET_VERSION GetDllVersion;

HINSTANCE hDll;
  hDll = LoadLibrary(&quot;Encoder.dll&quot;); //
  if(hDll == NULL){
    ShowMessage(&quot;Unable to load Encoder.dll&quot;);
  }else{
	GetDllVersion = (GET_VERSION)GetProcAddress(hDll,&quot;GetDllVersion&quot;);
  }
</code></pre>
<p>DANKE</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945482</guid><dc:creator><![CDATA[Wauschi]]></dc:creator><pubDate>Mon, 19 Dec 2005 11:54:46 GMT</pubDate></item><item><title><![CDATA[Reply to DLL _stdcall Stress. :-( on Mon, 19 Dec 2005 12:02:03 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=2" rel="nofollow">VCL/CLX (Borland C++ Builder)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/945490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945490</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 19 Dec 2005 12:02:03 GMT</pubDate></item><item><title><![CDATA[Reply to DLL _stdcall Stress. :-( on Mon, 19 Dec 2005 16:28:51 GMT]]></title><description><![CDATA[<p>Das Macro</p>
<p>__BORLANDC__ in Verbindung mit #ifdef</p>
<p>#ifdef __BORLANDC__<br />
# define AUSGABE __stdcall<br />
#endif</p>
<p>Des Weiteren</p>
<p>[url]<a href="http://www.marquardtnet.info/cecke/tutorials.8/8_dll.html#Der" rel="nofollow">http://www.marquardtnet.info/cecke/tutorials.8/8_dll.html#Der</a> Im- und Export[/url]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945681</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945681</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Mon, 19 Dec 2005 16:28:51 GMT</pubDate></item><item><title><![CDATA[Reply to DLL _stdcall Stress. :-( on Tue, 20 Dec 2005 14:39:10 GMT]]></title><description><![CDATA[<p>Danke, das war eine gute Idee. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/946333</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946333</guid><dc:creator><![CDATA[Wauschi]]></dc:creator><pubDate>Tue, 20 Dec 2005 14:39:10 GMT</pubDate></item></channel></rss>