Jump to content
Sign in to follow this  
isola

Delphi dll ERROR_BAD_EXE_FORMAT

Recommended Posts

I develop com-server using standard delphi ways.
All works fine while the option "ProjOptions->Compiling->Use debug .dcus" is disabled.
If I turn this option on, my client app(both c++, delphi) gets Windows error ERROR_BAD_EXE_FORMAT.
No matter: if it was CoCreateInstance or simple LoadLibrary call.
Is there a known problem?
My COM server binary size is approx 80Mb.
I have installed Delphi XE8 and Delphi 11.2
The results on these both systems are the same.
Can anybody show me the way: how can I avoid this error?
Thanks.                             

Share this post


Link to post

A little deeper

I ran library loading profiling:
https://ten0s.github.io/blog/2022/07/01/debugging-dll-loading-errors


The log is big. There is only error:
2818:37f4 @ 05671921 - LdrpProcessWork - ERROR: Unable to load DLL: "C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_a8625c1886757984\COMCTL32.dll", Parent Module: "C:\WINDOWS\System32\comdlg32.dll", Status: 0xc000007b

 

Status: 0xc000007b = (#define STATUS_INVALID_IMAGE_FORMAT      ((NTSTATUS)0xC000007BL))

""" C:\WINDOWS\WinSxS\x86 """ ??? My app is 64-bit

COM-server contains some side components, whose runtime packages all compiled as 64-bit code.

What does the option [Use debug dcus] add to the code?
Has anyone come across this?

Thanks!

Share this post


Link to post
46 minutes ago, isola said:

What does the option [Use debug dcus] add to the code?

You can find out in the Help:

 

Use debug .dcus

The debug DCUs contain debug information and are built with stack frames. When this option is checked, the compiler adds the debug DCU path to the search paths specified in Debug Source Path on the Embarcadero Debuggers page.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×