C# Windows Form Application with 86x unmanaged dll
-
Dear All, I have an unmanaged DLL developed by Delphi language and it's support 86x and 64x and I want to use the DLL in my c# windows form application which use any cpu as a platform target but this error occurred "System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at ScaleDLL.frmMain.AclasSDK_Initialize(Pointer Adjuct) at ScaleDLL.frmMain.frmMain_Load(Object sender, EventArgs e) in F:\Dot Net Projects\Dlls\ScaleDLL\ScaleDLL\frmMain.cs:line 147" and we can't change the platform target to 86x because we use other libraries and it is not work when change the platform and we need to use this dll on the AnyCpU platform. Please help me ASAP. Thank You
-
Dear All, I have an unmanaged DLL developed by Delphi language and it's support 86x and 64x and I want to use the DLL in my c# windows form application which use any cpu as a platform target but this error occurred "System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at ScaleDLL.frmMain.AclasSDK_Initialize(Pointer Adjuct) at ScaleDLL.frmMain.frmMain_Load(Object sender, EventArgs e) in F:\Dot Net Projects\Dlls\ScaleDLL\ScaleDLL\frmMain.cs:line 147" and we can't change the platform target to 86x because we use other libraries and it is not work when change the platform and we need to use this dll on the AnyCpU platform. Please help me ASAP. Thank You
It's not simple, not at all. Because you are using 64 bit libraries already, you can't access 32 bit libraries on the same process - even if you compile for "any cpu" that doesn't mean that a process can "switch" dynamically between the two. If you want to cleanly use your legacy DLL, you will need to either convert everything else to x86, convert the legacy DLL to 64 bit, or ... start reading: Accessing 32-bit DLLs from 64-bit code | Reflections on IT[^] Do not expect this to be a clean, neat, and easy solution. And no, I've never needed to do it - so I can't help you here...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Dear All, I have an unmanaged DLL developed by Delphi language and it's support 86x and 64x and I want to use the DLL in my c# windows form application which use any cpu as a platform target but this error occurred "System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at ScaleDLL.frmMain.AclasSDK_Initialize(Pointer Adjuct) at ScaleDLL.frmMain.frmMain_Load(Object sender, EventArgs e) in F:\Dot Net Projects\Dlls\ScaleDLL\ScaleDLL\frmMain.cs:line 147" and we can't change the platform target to 86x because we use other libraries and it is not work when change the platform and we need to use this dll on the AnyCpU platform. Please help me ASAP. Thank You
[Interprocess Communication Between 32-bit and 64-bit Applications (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203(v=vs.85).aspx)
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal