<?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 laden klappt nicht immer?]]></title><description><![CDATA[<p>Hallo.</p>
<p>Ich will mal nur so aus Test eine DLL laden. Ich habe mir mal paar aus Windows wahllos rauskopiert.</p>
<p>Nutze VisualC++ 6 und DLL's liegen im Ordner mit der EXE.</p>
<pre><code class="language-cpp">// keine &quot;OK&quot; Ausgabe
HINSTANCE DllInstance = NULL;
DllInstance = LoadLibrary(&quot;MMSYSTEM.DLL&quot;);
if (DllInstance) puts(&quot;OK&quot;);
</code></pre>
<pre><code class="language-cpp">// Ausgabe &quot;OK&quot;, funktioniert somit
HINSTANCE DllInstance = NULL;
DllInstance = LoadLibrary(&quot;aaaamon.dll&quot;);
if (DllInstance) puts(&quot;OK&quot;);
</code></pre>
<p>Kann mir jemand sagen warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173178/dll-laden-klappt-nicht-immer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 05:17:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173178.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Feb 2007 17:03:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL laden klappt nicht immer? on Mon, 12 Feb 2007 17:03:52 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>Ich will mal nur so aus Test eine DLL laden. Ich habe mir mal paar aus Windows wahllos rauskopiert.</p>
<p>Nutze VisualC++ 6 und DLL's liegen im Ordner mit der EXE.</p>
<pre><code class="language-cpp">// keine &quot;OK&quot; Ausgabe
HINSTANCE DllInstance = NULL;
DllInstance = LoadLibrary(&quot;MMSYSTEM.DLL&quot;);
if (DllInstance) puts(&quot;OK&quot;);
</code></pre>
<pre><code class="language-cpp">// Ausgabe &quot;OK&quot;, funktioniert somit
HINSTANCE DllInstance = NULL;
DllInstance = LoadLibrary(&quot;aaaamon.dll&quot;);
if (DllInstance) puts(&quot;OK&quot;);
</code></pre>
<p>Kann mir jemand sagen warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227583</guid><dc:creator><![CDATA[Heinzel]]></dc:creator><pubDate>Mon, 12 Feb 2007 17:03:52 GMT</pubDate></item><item><title><![CDATA[Reply to DLL laden klappt nicht immer? on Mon, 12 Feb 2007 17:22:30 GMT]]></title><description><![CDATA[<p>Ich würd gern über GetLastError() mir den Fehlercode ausgeben lassen, aber ich erhalte ja nur einen Wert. Wie gebe ich den dazugehörigen Fehlertext aus? Wäre nett wenn wer helfen könnte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227612</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227612</guid><dc:creator><![CDATA[Heinzel]]></dc:creator><pubDate>Mon, 12 Feb 2007 17:22:30 GMT</pubDate></item><item><title><![CDATA[Reply to DLL laden klappt nicht immer? on Mon, 12 Feb 2007 18:03:27 GMT]]></title><description><![CDATA[<p>Heinzel schrieb:</p>
<blockquote>
<p>Ich will mal nur so aus Test eine DLL laden. Ich habe mir mal paar aus Windows wahllos rauskopiert.</p>
</blockquote>
<p>So einfach lassen sich zunächst nicht alle DLL's laden. Es liegt zum einen daran, das eine DLL wiederum andere benötigt, die beim Laden automatisch mitgeladen werden müssen. Und wenn man wahllos mal eine DLL woandershin kopiert, dann kann das u.U. daneben gehen, da diese zusätzlichen DLL's nicht gefunden werden.</p>
<p>Nun habe ich festgestellt, dass der Depency Walker die MMSYSTEM.DLL nicht laden mag, mit dem Vermerk:</p>
<p><strong>&quot;No PE Signature found. This is not a valid Win32 module.&quot;</strong></p>
<p>Was das genau bedautet, dem bin ich nicht auf den Grund gegangen, aber es liegt wohl in der DLL. Vielleicht ist dieese DLL gar keine DLL, sondern ein COM Objekt. Auch diese können die Erweiterung DLL haben (macht z.B. Visual Basic, mit Visual C wäre es in der Regel eine OCX). Und die lassen sich so nicht unbedingt laden.</p>
<p>Gruss, Gio</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227642</guid><dc:creator><![CDATA[Gio]]></dc:creator><pubDate>Mon, 12 Feb 2007 18:03:27 GMT</pubDate></item><item><title><![CDATA[Reply to DLL laden klappt nicht immer? on Mon, 12 Feb 2007 18:09:01 GMT]]></title><description><![CDATA[<p>Stimmt!</p>
<p>Aber weiss vielleicht wer warum</p>
<pre><code class="language-cpp">DWORD dw = GetLastError();
char sBuffer[100];
FormatMessage(
	FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
	0,
	dw,
	MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
	sBuffer,
	strlen(sBuffer),
	NULL);
Ausgabe(sBuffer);
</code></pre>
<p>nur leeren String beinhaltet? Würde trotzdem für Zukunft gern wissen was genau schief lief. Vielleicht hätte das mir der Fehler ja gesagt nur kann ich mit 193 als ErrorCode garnichts anfangen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227648</guid><dc:creator><![CDATA[Heinzel]]></dc:creator><pubDate>Mon, 12 Feb 2007 18:09:01 GMT</pubDate></item><item><title><![CDATA[Reply to DLL laden klappt nicht immer? on Mon, 12 Feb 2007 19:04:55 GMT]]></title><description><![CDATA[<p>das MSDN (Oct 2001) sagt unter dem Index &quot;error codes (Win32)&quot;</p>
<p><em><strong>193 | %1 is not a valid Win32 application. | ERROR_BAD_EXE_FORMAT</strong></em></p>
<p>Vielleicht gibt es keinen Fehlereintrag im System. Wäre bei Bill nicht das erste mal <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>
<p>Ansonsten probier mal folgendes:</p>
<pre><code class="language-cpp">LPVOID lpMsgBuf;

  FormatMessage( 
      FORMAT_MESSAGE_ALLOCATE_BUFFER | 
      FORMAT_MESSAGE_FROM_SYSTEM | 
      FORMAT_MESSAGE_IGNORE_INSERTS,
      NULL,
      GetLastError(),
      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
      (LPTSTR) &amp;lpMsgBuf,
      0,
      NULL 
  );
  // Display the string.
  ::MessageBox( theApp.m_hMainFrame , (LPCTSTR)lpMsgBuf, &quot;NT Control - System Error&quot;, MB_OK | MB_ICONINFORMATION );
  // Free the buffer.
  LocalFree( lpMsgBuf );
</code></pre>
<p>Aber mehr, als &quot;not a valid Win32 application&quot; wird trotzdem nicht bei rauskommen.</p>
<p>Gruss, Gio</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227685</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227685</guid><dc:creator><![CDATA[Gio]]></dc:creator><pubDate>Mon, 12 Feb 2007 19:04:55 GMT</pubDate></item></channel></rss>