<?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 mit Borland C++ Builder 6 - klappt kein einbinden]]></title><description><![CDATA[<p>Hi leute</p>
<p>Ich hab mir jetzt ne dll im C++Builder programmiert, welche ich später in einem MS Visual Studio 6 einbinden möcht, geproggt. (Die 2 versch. Compiler deswegen, weil ich das Projekt im VS hab, ich jedoch was nur im C++ Builder zu laufen gebracht hab)<br />
aber is ja egal</p>
<p>jedenfalls, dll compiliert ect., jedoch kann ich die Funktion, die ich exportiere, nicht einbinden.<br />
das is mal der Funktionskopf (drinnen steht eigentlich nix anderes als char*-operationen und 1 funktionsaufruf)</p>
<pre><code class="language-cpp">#define EXPORT extern &quot;C&quot; __declspec(dllexport)
//...
EXPORT tDeviceData GetDeviceInformation(wchar_t* ClassName)
</code></pre>
<p>wobei tDeviceData ein struct ist, das ich auch in der header hab, die ich dann im VS-Projekt einbinde</p>
<p>das einbinden hab ich so erledigt:</p>
<pre><code class="language-cpp">HINSTANCE Lib = LoadLibrary(&quot;./../PCInfo.dll&quot;);
  if (!(int)Lib)
    ShowMessage(&quot;Error loading DLL&quot;);

  tGetDeviceInformation GetDeviceInfo = (tGetDeviceInformation)GetProcAddress(Lib, &quot;GetDeviceInformation&quot;);

  if (GetDeviceInfo == NULL)
    ShowMessage(&quot;Error loading function&quot;);
  else
  {
    tDeviceData Info = (*GetDeviceInfo)(L&quot;Win32_Processor&quot;);
    ShowMessage(Info.DeviceName);
  }
</code></pre>
<p>Dabei kommt mir immer die Meldung &quot;Error loading function&quot;</p>
<p>Ich hab dann auch schon gesucht und ne lösung mit der .def-Datei gefunden, hat aber auch nix genützt.<br />
Die Funktion lässt sich sowohl im VS als auch im C++Builder nicht laden<br />
Weiß jemand, woran der Fehler liegen könnt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/101897/dll-mit-borland-c-builder-6-klappt-kein-einbinden</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 06:16:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/101897.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Feb 2005 18:56:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dll mit Borland C++ Builder 6 - klappt kein einbinden on Sun, 20 Feb 2005 18:56:17 GMT]]></title><description><![CDATA[<p>Hi leute</p>
<p>Ich hab mir jetzt ne dll im C++Builder programmiert, welche ich später in einem MS Visual Studio 6 einbinden möcht, geproggt. (Die 2 versch. Compiler deswegen, weil ich das Projekt im VS hab, ich jedoch was nur im C++ Builder zu laufen gebracht hab)<br />
aber is ja egal</p>
<p>jedenfalls, dll compiliert ect., jedoch kann ich die Funktion, die ich exportiere, nicht einbinden.<br />
das is mal der Funktionskopf (drinnen steht eigentlich nix anderes als char*-operationen und 1 funktionsaufruf)</p>
<pre><code class="language-cpp">#define EXPORT extern &quot;C&quot; __declspec(dllexport)
//...
EXPORT tDeviceData GetDeviceInformation(wchar_t* ClassName)
</code></pre>
<p>wobei tDeviceData ein struct ist, das ich auch in der header hab, die ich dann im VS-Projekt einbinde</p>
<p>das einbinden hab ich so erledigt:</p>
<pre><code class="language-cpp">HINSTANCE Lib = LoadLibrary(&quot;./../PCInfo.dll&quot;);
  if (!(int)Lib)
    ShowMessage(&quot;Error loading DLL&quot;);

  tGetDeviceInformation GetDeviceInfo = (tGetDeviceInformation)GetProcAddress(Lib, &quot;GetDeviceInformation&quot;);

  if (GetDeviceInfo == NULL)
    ShowMessage(&quot;Error loading function&quot;);
  else
  {
    tDeviceData Info = (*GetDeviceInfo)(L&quot;Win32_Processor&quot;);
    ShowMessage(Info.DeviceName);
  }
</code></pre>
<p>Dabei kommt mir immer die Meldung &quot;Error loading function&quot;</p>
<p>Ich hab dann auch schon gesucht und ne lösung mit der .def-Datei gefunden, hat aber auch nix genützt.<br />
Die Funktion lässt sich sowohl im VS als auch im C++Builder nicht laden<br />
Weiß jemand, woran der Fehler liegen könnt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/728261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/728261</guid><dc:creator><![CDATA[Chimaira]]></dc:creator><pubDate>Sun, 20 Feb 2005 18:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to Dll mit Borland C++ Builder 6 - klappt kein einbinden on Sun, 20 Feb 2005 19:39:19 GMT]]></title><description><![CDATA[<p>gib mal in der KOmmandozeile &quot;impdef PCInfo PCInfo&quot; ein<br />
und schau dir die Datei PCInfo.def an.<br />
Da müsste dann irgendwo der Name drinstehn, den du bei GetProcAddress benutzen musst</p>
<p>Meistens dann &quot;_GetDeviceInformation&quot;, aber schau lieber nach</p>
]]></description><link>https://www.c-plusplus.net/forum/post/728285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/728285</guid><dc:creator><![CDATA[YASC]]></dc:creator><pubDate>Sun, 20 Feb 2005 19:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to Dll mit Borland C++ Builder 6 - klappt kein einbinden on Sun, 20 Feb 2005 19:43:23 GMT]]></title><description><![CDATA[<p>Hat geklappt!<br />
Big thx!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/728302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/728302</guid><dc:creator><![CDATA[Chimaira]]></dc:creator><pubDate>Sun, 20 Feb 2005 19:43:23 GMT</pubDate></item></channel></rss>