If the application initialization fails (0xc0000142. Please click "Confirm" to check whether the dependency is correct. You can use the "depends.exe" tool to check whether the dependency is correct. If there is no problem, you can use tools such as resourcehacker to check the manifest information of the resource segments of EXE and DLL, and check whether the dependent CRT is correct, note that the information between different DLL versions may be different (one EXE cannot load multiple versions of CRT at the same time ). If the problem persists, you can only analyze it through the debugger. Run devenv.exe program path to start the program, open the following file, and set the breakpoint in the corresponding place:
DLL entry point:
C:/program files/Microsoft Visual Studio 8/VC/CRT/src/dllcrt0.c
Bool winapi
_ Dllmaincrtstartup (
Handle hdllhandle,
DWORD dwreason,
Lpvoid lpreserved
)
{
If (dwreason = dll_process_attach)
{
/*
* The/GS Security Cookie must be initialized before any exception
* Handling targetting the current image is registered. No Function
* Using exception handling can be called in the current image
* After _ security_init_cookie has been called.
*/
_ Security_init_cookie ();
}
Return _ dllmaincrtstartup (hdllhandle, dwreason, lpreserved );
}
When a DLL fails to be loaded, you can set a breakpoint in line 3 of C:/program files/Microsoft Visual Studio 8/VC/CRT/src/dllcrt0.c.
Bool winapi _ crt_init (
Handle hdllhandle,
DWORD dwreason,
Lpvoid lpreserved
)
EXE part
C:/program files/Microsoft Visual Studio 8/VC/CRT/src/crt0.c 199 action EXE entry point
_ Declspec (noinline)
Int
_ Tmaincrtstartup (
Void
)
C:/program files/Microsoft Visual Studio 8/VC/CRT/src/_ file. C. Class class
Int _ cdecl _ initstdio (void)