<?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]]></title><description><![CDATA[<p>hi</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;iostream&gt;

using namespace std;

int main()
{
   typedef char* (CALLBACK* FUNCPTR)(void);
   HINSTANCE hDLL;
   FUNCPTR funcptr;

   hDLL = LoadLibrary(&quot;mydll.dll&quot;);

   if(hDLL != NULL)
   {
     funcptr = (FUNCPTR)GetProcAddress(hDLL, &quot;myReturn&quot;);
     if(funcptr == NULL)
     {
       FreeLibrary(hDLL);
       cout &lt;&lt; &quot;Fehler!&quot; &lt;&lt; endl &lt;&lt; endl;
       return -1;
     }
     else
       cout &lt;&lt; funcptr() &lt;&lt; endl &lt;&lt; endl;
   }
  return 0;
}
</code></pre>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

char* WINAPI myReturn(void);

BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReversed)
{
  return true;
}

char* WINAPI myReturn(void)
{
   return &quot;hello world&quot;;
}
</code></pre>
<p>die ausgabe ist Fehler!, wieso gibt GetProcAddress NULL zurück? ich versteh das nicht eigentlich sollte es funktionieren<br />
gruß xerxes</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/76993/dll</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 12:58:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/76993.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Jun 2004 15:14:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dll on Wed, 16 Jun 2004 15:14:55 GMT]]></title><description><![CDATA[<p>hi</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;iostream&gt;

using namespace std;

int main()
{
   typedef char* (CALLBACK* FUNCPTR)(void);
   HINSTANCE hDLL;
   FUNCPTR funcptr;

   hDLL = LoadLibrary(&quot;mydll.dll&quot;);

   if(hDLL != NULL)
   {
     funcptr = (FUNCPTR)GetProcAddress(hDLL, &quot;myReturn&quot;);
     if(funcptr == NULL)
     {
       FreeLibrary(hDLL);
       cout &lt;&lt; &quot;Fehler!&quot; &lt;&lt; endl &lt;&lt; endl;
       return -1;
     }
     else
       cout &lt;&lt; funcptr() &lt;&lt; endl &lt;&lt; endl;
   }
  return 0;
}
</code></pre>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

char* WINAPI myReturn(void);

BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReversed)
{
  return true;
}

char* WINAPI myReturn(void)
{
   return &quot;hello world&quot;;
}
</code></pre>
<p>die ausgabe ist Fehler!, wieso gibt GetProcAddress NULL zurück? ich versteh das nicht eigentlich sollte es funktionieren<br />
gruß xerxes</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541704</guid><dc:creator><![CDATA[_xerxes_]]></dc:creator><pubDate>Wed, 16 Jun 2004 15:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to dll on Wed, 16 Jun 2004 15:51:27 GMT]]></title><description><![CDATA[<p>Ich nehme an, dass deine Funktion nicht als myReturn exportiert wird (Dependency Walker) - mit der Forensuche solltest du die Lösung finden (hab sie gerade auch nicht 100% parat <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541741</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 16 Jun 2004 15:51:27 GMT</pubDate></item><item><title><![CDATA[Reply to dll on Wed, 16 Jun 2004 16:04:07 GMT]]></title><description><![CDATA[<p>Der Funktionsname muss entweder in eine def-Datei eingetragen sein oder bei VC kann der __declspec(dllexport) Modifier benutzt werden. Bei der zweiten Möglichkeit muss man darauf achten, dass der Name, je nach calling convention, dekoriert wird und entspricht nicht dem eigentlichen Namen der exportierten Funktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541754</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Wed, 16 Jun 2004 16:04:07 GMT</pubDate></item><item><title><![CDATA[Reply to dll on Wed, 16 Jun 2004 16:25:27 GMT]]></title><description><![CDATA[<p>hi<br />
ich würde es lieber mit ner .def datei lösen, doch ich weis nicht im weitesten sinne was eine .def datei ist bzw wie ich sie erstelle oder ob sie schon existiert. ich benutze mvs6</p>
<p>gruß xerxes</p>
<p>edit:<br />
bzw was genau ich in de .def datei eintragen muss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541772</guid><dc:creator><![CDATA[_xerxes_]]></dc:creator><pubDate>Wed, 16 Jun 2004 16:25:27 GMT</pubDate></item><item><title><![CDATA[Reply to dll on Wed, 16 Jun 2004 19:28:53 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/library/en-us/vccore/html/_core_Export_from_a_DLL.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/vccore/html/_core_Export_from_a_DLL.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/541905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541905</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 16 Jun 2004 19:28:53 GMT</pubDate></item></channel></rss>