Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe ein Programm unter VC 2005, bei kompilieren bekomme ich keine Fehler und keine warnungen, beim start des Programms allerdings lande ich in eine exception die ich

überhaupt nicht zuordnen kann, ich habe schon sehr viel probiert, alle Mögliche Pfade Einstellungen usw. überprüft leider ohne erfolg. Das Programm kommt nicht mal zu die erste Funktion, das Programm beim start wirf mir solchen fehler

Unhandled exception at 0x7c974ed1 in XYZ.exe: 0xC0000142: DLL Initialization Failed.

mit der Möglichkeit zur abrechen oder weiter machen, bei weiter machen startet das Programm und zeigt mir wieder etliche Fehler mit dem

verweis auf die Datei atldebugapi.cpp die sich angeblich auf dem Laufwerk F befinden sollte, dieses Laufwerk ist aber auf dem Rechner nicht vorhanden :(

Es seht so aus das ihn eine dll fehlt??, wie kann ich überprüfen welche dlls und vor allem in welche Reihenfolge er die dlls's bezieht

Hat vielleicht jemand eine Idee?

Gruß bigpoint

  • Autor
Wie sieht denn der Callstack aus, wenn du das mit dem Debugger ausführst?

zu dem Zeitpunkt

Unhandled exception at 0x7c974ed1 in XYZ.exe: 0xC0000142: DLL Initialization Faile


ntdll.dll!7c974ed1()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7c974ed1()
ntdll.dll!7c92eb05()
ntdll.dll!7c92eb41()
ntdll.dll!7c91e273()
ntdll.dll!7c96146b()
ntdll.dll!7c94f8fb()
ntdll.dll!7c92a120()
ntdll.dll!7c932c66()
ntdll.dll!7c91eac7()
kernel32.dll!7c810665()
[/PHP]

Der wird dir hier vermutlich nicht helfen, da dein eigener Code ja gar nicht zu Ausführung kommt. Die Fehlermeldung kommt daher, dass die DllMain-Funktion einer der DLLs, die dein Programm durch Load-time Dynamic Linking einbindet, FALSE zurückgibt.

Was passiert denn, wenn du einen Release-Build erstellst?

  • Autor

Eigentlich das gleiche.

Call Stack von Release

ntdll.dll!_RtlRaiseStatus@4() + 0x26 bytes

ntdll.dll!__LdrpInitialize@12() + 0x26b95 bytes

ntdll.dll!_KiUserApcDispatcher@20() + 0x7 bytes

kernel32.dll!7c810665()

[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

  • Autor
Hat das schon mal funktioniert, oder ging das noch nie?.

ja, auf anderen Rechner läuft es problemlos

Prüf bitte mal mit dem Dependency Walker, ob auch wirklich alle DLL-Abhängigkeiten erfüllt sind.

einziege sache die die exe fällt ist msjava.dll, die fehlt aber auch bei anderen anwendungen die bei mit laufen

  • Autor

Prüf bitte mal mit dem Dependency Walker, ob auch wirklich alle DLL-Abhängigkeiten erfüllt sind.

Die einzeige DLL die in Dependency Walker nicht "schön" auschaut ist MPR.dll

Dependency Walker liefert:

Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

PS

Die msjava.dll ist jetzt auch schon in ordnung, die java virtual machine von ms wahr nicht aktualisiert

Jede DLL braucht eine DllMain.

Allerdings ist die DllMain in irgendeiner MFC Header Datei schon definiert. Das heißt bei mir kam beim einbinden dieses Headers immer der Fehler das die DllMain doppelt definiert wäre, so dass ich meine gelöscht habe.

Ich glaub das war in der afx.h oder irgendwas das die einbindet.

  • 4 Wochen später...
  • Autor

Mittlerweile konnte ich die böse DLL finden, das Problem besteht jedoch nach wie vor.

Was ich gemacht habe, ich habe eine neue DLL und ein neues Programm (.exe) der die DLL einbindet erstellt, zu erst ist die DLL ganz "nackt", wenn ich sie in die .exe Programm mit LoadLibrary oder LoadLibraryEx einbinde klapt alles wunderbar, jetzt kopiere ich alle Klassen die die DLL benutzt (denn sie ist nichts anderes als sammlung von Klassen) kompeiliere ich sie und versuche wieder in der exe Programm einzubinden etwa so:


CString s("test.dll");
HMODULE hm = LoadLibrary(s);
HRESULT hr = GetLastError();
[/PHP]

In hr steht

hr = 0x0000045a Eine DLL-Initialisierungsroutine ist fehlgeschlagen.

  • Autor

Wie sieht die DllMain aus?



// test.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include <afxdllx.h>
#ifdef _MANAGED
#error Please read instructions in moo.cpp to compile with /clr
// If you want to add /clr to your project you must do the following:
// 1. Remove the above include for afxdllx.h
// 2. Add a .cpp file to your project that does not have /clr thrown and has
// Precompiled headers disabled, with the following text:
// #include <afxwin.h>
// #include <afxdllx.h>
#endif

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


static AFX_EXTENSION_MODULE testDLL = { NULL, NULL };

#ifdef _MANAGED
#pragma managed(push, off)
#endif

extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);

if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("test.DLL Initializing!\n");

// Extension DLL one-time initialization
if (!AfxInitExtensionModule(testDLL, hInstance))
return 0;

new CDynLinkLibrary(testDLL);

}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("test.DLL Terminating!\n");

// Terminate the library before destructors are called
AfxTermExtensionModule(testDLL);
}
return 1; // ok
}

#ifdef _MANAGED
#pragma managed(pop)
#endif

[/PHP]

Ich habe 64 Bit rechner, ist es vielleicht die ursache?

Was meinst du unter globalen Objekten,

Gibt es irgendwelche globalen Variablen in der DLL? Oder gibt es Klassen, die statische Member mit nichttrivialem Konstruktor haben?

Was passiert, wenn du die Zeile mit den new auskommentierst?

Ach ja, 1114 ist ERROR_DLL_INIT_FAILED, das wussten wir schon ;)

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.