<?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[LoadLibrary schlägt sporadisch fehl]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>Ich habe ein seltsames und schwer zu reproduierendes Problem mit der<br />
Funktion LoadLibrary.</p>
<p>Das Programm läuft mehrere Wochen problemlos bis dann folgendes Fehlerbild eintritt.</p>
<p>Jeder zweite Start des Programmes verursacht dann einen Fehler beim Aufruf von<br />
LoadLibary 1114 (&quot;A dynamic link library (DLL) initialization routine failed&quot;)</p>
<p>Dieser Fehler entsteht z.B. wenn die dll nicht vorhanden ist, gefunden werden kann<br />
oder auch wennn die dll im DllMain (DLL_PROCESS_ATTACH) ein false zurück liefert.</p>
<p>In meinem Fall existiert die dll, das dllMain wird aufgerufen und liefert true zurück ?!</p>
<p>Wisst ihr sonstige Gründe warum LoadLibrary mit Fehler 1114 fehlschlägt?<br />
oder andere ideen ?</p>
<p>Danke Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/170402/loadlibrary-schlägt-sporadisch-fehl</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 03:44:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/170402.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Jan 2007 14:06:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Mon, 15 Jan 2007 14:06:37 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>Ich habe ein seltsames und schwer zu reproduierendes Problem mit der<br />
Funktion LoadLibrary.</p>
<p>Das Programm läuft mehrere Wochen problemlos bis dann folgendes Fehlerbild eintritt.</p>
<p>Jeder zweite Start des Programmes verursacht dann einen Fehler beim Aufruf von<br />
LoadLibary 1114 (&quot;A dynamic link library (DLL) initialization routine failed&quot;)</p>
<p>Dieser Fehler entsteht z.B. wenn die dll nicht vorhanden ist, gefunden werden kann<br />
oder auch wennn die dll im DllMain (DLL_PROCESS_ATTACH) ein false zurück liefert.</p>
<p>In meinem Fall existiert die dll, das dllMain wird aufgerufen und liefert true zurück ?!</p>
<p>Wisst ihr sonstige Gründe warum LoadLibrary mit Fehler 1114 fehlschlägt?<br />
oder andere ideen ?</p>
<p>Danke Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210261</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 15 Jan 2007 14:06:37 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Mon, 15 Jan 2007 16:50:14 GMT]]></title><description><![CDATA[<p>Was machst Du denn damit es wieder für mehrere Wochen läuft?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210367</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210367</guid><dc:creator><![CDATA[connan]]></dc:creator><pubDate>Mon, 15 Jan 2007 16:50:14 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Mon, 15 Jan 2007 20:28:50 GMT]]></title><description><![CDATA[<p>Evtl zieht deine DLL andere DLLs nach, und diese wurden warum auch immer auf dem anderen System beschädigt/gelöscht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210469</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210469</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Mon, 15 Jan 2007 20:28:50 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Mon, 15 Jan 2007 20:30:49 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9676">@Pellaeon</a>: Dann würde es aber immer haken und nicht sporadisch!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210472</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210472</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 15 Jan 2007 20:30:49 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Mon, 15 Jan 2007 20:48:53 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9676">@Pellaeon</a>: Dann würde es aber immer haken und nicht sporadisch!</p>
</blockquote>
<p>hm stimmt, hätte den Post ganz lesen sollen und nicht nur überfliegen^^</p>
<p>Aber ich würd trotzdem mal nachschauen, was an &quot;Fremd-DLLs&quot; nachgezogen wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210479</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210479</guid><dc:creator><![CDATA[Pellaeon]]></dc:creator><pubDate>Mon, 15 Jan 2007 20:48:53 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Tue, 16 Jan 2007 07:32:03 GMT]]></title><description><![CDATA[<p>Sind es Deine DLL's. Dann würde mich mal interessieren was Du in Deinem DLL-Main drin hast. Kann es sein, dass es Speicherknapphat oder andere ressourcen sind?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210547</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210547</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 16 Jan 2007 07:32:03 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Tue, 16 Jan 2007 08:12:30 GMT]]></title><description><![CDATA[<p>Hallo connan</p>
<p>&quot;was machst du damit es wieder Wochen läuft&quot;</p>
<p>tja, recht seltsam, aber wir haben von einem IO Gerät die Registry exportiert und !!! vollständig auf ein NIO Gerät eingespielt, danach geht's wieder ne Weile ... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Gruss Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210558</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210558</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 16 Jan 2007 08:12:30 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Tue, 16 Jan 2007 09:59:39 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9676">@Pellaeon</a> und <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@Martin</a> Richter</p>
<p>Die Software Konstruktion (eigene Software) ist wie folgt:</p>
<p>Haupprogramm -&gt; dll_1 -&gt; dll_2</p>
<p>dll_1 ist statisch gebunden, über das *.lib file.<br />
dll_2 wir von dll_1 dynamisch (zur Laufzeit) mit LoadLibary geladen.</p>
<p>Ich habe noch etwas geforscht und rausgefunden,<br />
dass im DllMain kein LoadLibary ausgeführt oder initiert werden darf.</p>
<p>dll_2 ruft im DllMain <strong>WSAStartup</strong> auf.<br />
<strong>WSAStartup</strong> führt zum dynamischen Laden einer winsockX.dll.<br />
Das funktioniert auch (wenn man den returns glauben kann)</p>
<p>Im Moment tippe ich darauf das dies das Problem ist.<br />
Ich bin dabei den Aufruf von <strong>WSAStartup</strong> heraus zu nehmen.<br />
Auch das Sporadische kann ich damit erklären:<br />
Das Programm wird mit mehreren Programmen (fast) gleichzeitig gestartet.<br />
Je nach Timing führt <strong>WSAStartup</strong> zum vollstängien Laden der<br />
winsockX.dll oder eben nur zum erneuten instanzieren.</p>
<p>Mal sehen ob es das Problem ist,<br />
ich kann es leider nicht bei mir reproduzieren <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Gruss Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210583</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 16 Jan 2007 09:59:39 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Tue, 16 Jan 2007 18:51:30 GMT]]></title><description><![CDATA[<p>Frank Erdorf schrieb:</p>
<blockquote>
<p>dll_2 ruft im DllMain <strong>WSAStartup</strong> auf.<br />
<strong>WSAStartup</strong> führt zum dynamischen Laden einer winsockX.dll.</p>
</blockquote>
<p>Nun wundert mich nichts!</p>
<p>In DllMain darf man:<br />
1. Kein LoadLibrary aufrufen<br />
2. Keine anderen Funktionen starten, die andere DLLs laden<br />
3. Keine anderen Funktionen außer den niederwertigen Kernel Funktionen ausführen.<br />
4. Das schließt auch ein, dass keine DLL Funktionen aufgerufen werden die per Delayload gebunden sind!</p>
<p>Siehe ausführlicher Thread hier:<br />
<a href="http://groups.google.com/group/microsoft.public.de.vc/browse_thread/thread/f21bc077f3cb6c63" rel="nofollow">http://groups.google.com/group/microsoft.public.de.vc/browse_thread/thread/f21bc077f3cb6c63</a></p>
<p>Siehe auch MSDN Doku: Dllmain<br />
<a href="http://msdn2.microsoft.com/en-us/library/ms682583.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms682583.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210700</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 16 Jan 2007 18:51:30 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Tue, 16 Jan 2007 15:42:53 GMT]]></title><description><![CDATA[<p>Schmeiss das WSAStartup ins Hauptprogramm oder DLL 1.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210852</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 16 Jan 2007 15:42:53 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Fri, 19 Jan 2007 10:28:21 GMT]]></title><description><![CDATA[<p>Hallo zusammen, das Problem ist gelöst:</p>
<p>1. WSAStartup ins Hauptprogramm<br />
2. WSAStartup aus dem DllMain herausgenommen und später zur Laufzeit ausgeführt.<br />
3. einfache Wiederholung von LoadLibary im Fehlerfall.</p>
<p>Insgesamt bleibt die Sache verwunderlich, weil in meinem Fehlerfall:</p>
<p>Zwar das LoadLibary NULL liefert,<br />
aber die dll geladen wurde, das DllMain angesprungen wurde und<br />
sogar WSAStartup erfolgreich war.</p>
<p>Das alles sieht eher nach einem BUG aus, der mehr oder weniger gut aus dokumentiert wurde.<br />
Bei WSA Startup steht weder das es intern ein LoadLibary macht noch das es nicht ins DllMain gehört...<br />
Und das Fehlerverhalten ist nicht deterministisch,<br />
- ich würde ja verstehen wenn das 2. LoadLibary einen Fehler liefert ...</p>
<p>Vielen Dank an alle, Gruss Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1212526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1212526</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 19 Jan 2007 10:28:21 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Sat, 20 Jan 2007 09:30:17 GMT]]></title><description><![CDATA[<p>Naja, es wird in der Doku zu DllMain ja ausdrücklich davor gewarnt...</p>
<blockquote>
<p><strong>Calling imported functions other than those located in Kernel32.dll may result in problems that are difficult to diagnose.</strong> For example, calling User, Shell, and COM functions can cause access violation errors, because some functions in their DLLs call LoadLibrary to load other system components. Conversely, calling those functions during termination can cause access violation errors because the corresponding component may already have been unloaded or uninitialized.</p>
</blockquote>
<p>Und da WSAStartup nunmal nicht in KERNEL32 sondern in WS2_32.DLL beheimatet ist...</p>
<p>Ist also kein BUG, bloss da MS auch weiss dass so viele Programmierer sich nicht an die Regeln halten, ham sie halt ihr Möglichstes getan damit es in den meisten Fällen &quot;trotzdem funktioniert&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1213068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1213068</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sat, 20 Jan 2007 09:30:17 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary schlägt sporadisch fehl on Sat, 20 Jan 2007 11:05:22 GMT]]></title><description><![CDATA[<p>Gegen WSASTartup in DLLMain Spricht IMHO nichts. Das macht sogar MS in seinen MDAC Tools und bzgl. dazu gab es mal einen Bugfix (der aber mit dem Problem hier nichts zu tun hat).</p>
<p>Dein Problem ist (so ich Deine Schilderung verstanden habe), dass Du selbst LoadLibrary aus der ersten DLL aufrufst. Das ist das Problem! Denn in diesem Fall kann es sein, dass eine DllMain Routine der bereits geladenen DLLs noch nicht gelaufen ist!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1213092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1213092</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 20 Jan 2007 11:05:22 GMT</pubDate></item></channel></rss>