Participant
May 19, 2022
Question
x64 C# WinForm with AcroPDF.dll crashes with System.BadImageFormatException
- May 19, 2022
- 2 replies
- 1057 views
Windows 10 (x64) 20H2 with 2022-05 Cumulative Updates installed
Adobe Acrobat Reader DC (2022.001.20117, 64-bit)
I have a simple WinForms form where I added the Adobe PDF Reader COM component. It just initializes the component and loads a PDF. When I build in x86, the PDF is shown. When I build in x64, the application crashes with:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Windows.Forms.SafeNativeMethods._TrackMouseEvent(TRACKMOUSEEVENT tme)
at System.Windows.Forms.Control.HookMouseEvent()
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)I have enable debugging for Acrobat and captured the logs with DebugView for both architectures (see attached files x86.log and x64.log).
How can I make x64 work?
Thanks,
Bernhard
