<?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 Problem]]></title><description><![CDATA[<p>Morgen,<br />
ich habe einige Funktionen einer DLL exportiert. Jedoch muss ich bei GetProcAddress komische Funktionsnamen eingeben, damit ich diese nutzen kann.<br />
z.B. ?Function@@XZAZY... Weiß jemand von euch woran dass liegen könnte?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/110154/dll-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 22:11:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/110154.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 May 2005 08:35:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 08:35:18 GMT]]></title><description><![CDATA[<p>Morgen,<br />
ich habe einige Funktionen einer DLL exportiert. Jedoch muss ich bei GetProcAddress komische Funktionsnamen eingeben, damit ich diese nutzen kann.<br />
z.B. ?Function@@XZAZY... Weiß jemand von euch woran dass liegen könnte?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/790433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790433</guid><dc:creator><![CDATA[Herrmann]]></dc:creator><pubDate>Wed, 18 May 2005 08:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 09:09:09 GMT]]></title><description><![CDATA[<p>Hab das irgendwie grad nur noch sehr wage in Erinnerung, aber es gab auch eine Möglichkeit eine (.DEF???) Datei mit den Funktions-Namen dem Projekt hinzuzufügen, damit diese nicht durch Name-Extension (hieß das so) verändert werden.</p>
<p>Vielleicht hilft dir ja das ein wenig:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-p-is-284764.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-p-is-284764.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/790455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790455</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 18 May 2005 09:09:09 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 09:11:10 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">extern &quot;C&quot;
{

}
</code></pre>
<p>ist die lösung, ausser du möchtest klassen exportieren dann solltest du ein<br />
pluginsystem schreiben.<br />
<a href="http://www.cpp-tutor.de/cpp/le07/le07_03_d1.htm" rel="nofollow">http://www.cpp-tutor.de/cpp/le07/le07_03_d1.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/790461</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790461</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 18 May 2005 09:11:10 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 14:29:12 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/417">@miller_m</a>, extern &quot;C&quot; hat leider nicht funktioniert.<br />
Ich poste jetzt einfach mal meinen Code. Ich sehe den Fehler bzw. das Problem nicht.</p>
<p><strong>Testanwendung</strong></p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
  LPSTR lpCmdLine, int nCmdShow )
{
  MSG msg;

  int iRes = 0;  
  HMODULE hModule = LoadLibrary( &quot;dllbase.dll&quot; );

  if ( hModule )
  {
    // Funktioniert nicht
    FARPROC proc = GetProcAddress( hModule, &quot;FirstDLLFunct&quot; );
    // Funktioniert komischer Weise
    FARPROC proc = GetProcAddress( hModule, &quot;?FirstDLLFunct@@YGHXZ&quot; );
    if ( proc )
      iRes = proc();
    FreeLibrary( hModule );
  };

  while ( GetMessage( &amp;msg, NULL, 0, 0 ) )
  {
    TranslateMessage( &amp;msg );
    DispatchMessage( &amp;msg );
  };

  return 0;
};
</code></pre>
<p><strong>DLL.cpp</strong></p>
<pre><code class="language-cpp">#include &quot;dllbase.hpp&quot;

HINSTANCE hInst;

extern &quot;C&quot; __declspec(dllexport) int __stdcall FirstDLLFunct( void )
{
  char cName[MAX_PATH];

  if ( GetModuleFileName( hInst, cName, sizeof( cName ) ) )
  {
    MessageBox( NULL, cName, NULL, MB_OK );
  };

  return 100;
};

BOOL WINAPI DllMain( HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved )
{
  hInst = hModule;           

  switch ( dwReason )
  {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
      break;
  }

  return TRUE;
};
</code></pre>
<p><strong>DLL.hpp</strong></p>
<pre><code class="language-cpp">#ifndef DLLBASE_HPP
#define DLLBASE_HPP

#include &lt;windows.h&gt;

extern &quot;C&quot; __declspec(dllexport) int __stdcall FirstDLLFunct( void );

BOOL WINAPI DllMain( HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved );

#endif //DLLBASE_HPP
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/790816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790816</guid><dc:creator><![CDATA[Herrmann]]></dc:creator><pubDate>Wed, 18 May 2005 14:29:12 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 14:55:06 GMT]]></title><description><![CDATA[<p>ich kann es gerade nicht test aber ich glaub das __stdcall haut es wieder<br />
zusammen. bin mir aber nicht sicher.<br />
probier mal</p>
<pre><code class="language-cpp">extern &quot;C&quot; __declspec(dllexport) int FirstDLLFunct()
{
//..
};
</code></pre>
<p>welchen compiler verwendest du? afaik verwendet vc normalerweise __cdecl<br />
könnte auch nen problem sein.</p>
<p>wenn du sowieso dynamisch auf die dll zurückgreifst kannst du dir die<br />
definition der funktion im header bzw. sogar den ganzen header schenken.</p>
<p>wichtiges tool zum dll programmieren<br />
<a href="http://www.dependencywalker.com/" rel="nofollow">http://www.dependencywalker.com/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/790847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790847</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 18 May 2005 14:55:06 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 16:09:37 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/417">@miller_m</a>, der Fehler lag wirklich am __stdcall. Darauf wäre ich warscheinlich als letztes gekommen. Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/790926</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790926</guid><dc:creator><![CDATA[Herrmann]]></dc:creator><pubDate>Wed, 18 May 2005 16:09:37 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 16:11:33 GMT]]></title><description><![CDATA[<p>...ne *.def-Datei kann da helfen:</p>
<pre><code class="language-cpp">LIBRARY   NameDerDLL
EXPORTS  
       FunktionInDerDLL
       EineWeitereFunktion
</code></pre>
<p>...quasi Funktionsnamen ohne Parameter auflisten. Die Datei dann dem Projekt hinzufügen und neu-compilen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/790928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790928</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Wed, 18 May 2005 16:11:33 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Problem on Wed, 18 May 2005 16:18:34 GMT]]></title><description><![CDATA[<p>funktioniert aber nicht mit allen compilern, migw kann es afaik nicht oder ich hab es noch nicht hinbekommen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/790932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/790932</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 18 May 2005 16:18:34 GMT</pubDate></item></channel></rss>