error 126 specified module could not found

contains all delphi packages mentioned below
Post Reply
mazluta
Posts: 2
Joined: Sun Jan 03, 2021 9:54 am

error 126 specified module could not found

Post by mazluta »

i worte some console app using DELPHI-IMIBO to change the category of outlook message.
the code for 32 and 64 are the same.
i create exe32 and exe64, each one get the same params,

on exe 32 - all work.
on exe 64 even before initialization
it raise exception "error 126 specified module could not found".
i tried use exe walkthrough like depends22_x64 (exe64,...) and i look for all the dll in the list.
all dll exists in the system32 or wow64.

the madexcept (ver 5) dont give nothing,
how can i tell what MODULE is missing, how can i trace delphi exe load resorce?

mazluta
madshi
Site Admin
Posts: 10365
Joined: Sun Mar 21, 2004 5:25 pm

Re: error 126 specified module could not found

Post by madshi »

If it's the OS loader which errors out before your EXE/DLL could even be loaded then madExcept wasn't even initialized yet, so it can't help in cases like this.

It could be something funky like one of the required dlls being located in the application path, and this dll being 32bit. In that case the OS loader might try to load it but fails because it's the wrong bitdepth. This is just one possible explanation, though.

I could you could try to use a file monitor to see which DLL files the OS tries to access before it fails? I think SysInternals had a free file monitor available at some point.
mazluta
Posts: 2
Joined: Sun Jan 03, 2021 9:54 am

Re: error 126 specified module could not found

Post by mazluta »

hi madshi.

i use all kind of walkthrough but i didn't see any dll that exists in system32 but not exist in wow64.
i tried buil the same app with forms (not console) but the same error happen.

on the 80' we wrote in COBOL and able to write some TRACE every line from the start.
can i do it in delphi?
log- start....
log- load a1... (dll/drv/...)
log- load a2....
run api x1...
run api x2?

is it possible?

Yossi
madshi
Site Admin
Posts: 10365
Joined: Sun Mar 21, 2004 5:25 pm

Re: error 126 specified module could not found

Post by madshi »

As I said: If it's the OS loader who refuses to load your EXE/DLL, then there's no way to log anything because in that case not a single line of code of your EXE/DLL will even be executed.

I guess you could try compiling your 64bit exe with all your source code commented out and see if it runs fine then. If it does, put the source code back in piece by piece. If it doesn't then try creating a new empty project. Does that run fine? If it does, copy your source code over from the non-running project.

Hope that helps?
Post Reply