Search code examples
internet-explorerdlllabviewformatexception

Exception from HRESULT: 0x8007000B Incorrect Format IESHIMS.DLL


I maintain a Visual Basic program that was made about five years ago. All other desktops that use the program are currently x32 bit OS. Recently I was given a x64 bit system desktop. I have not exported for use a version of this program compiled on this desktop.

When trying to run a project from this program, I received the following Exception:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

After some searching, I found that this error is caused by CPU types that do not match. Because I am the only one with this error, and the only x64 bit CPU running this program, I figured this was the best explanation. (Some details can be found here: "An attempt was made to load a program with an incorrect format" even when the platforms are the same)

I checked the project's compile settings in Visual Basic; the Target CPU is set to "AnyCPU". The project contained a DLL file with a matching name. (The DLL file is downloaded locally during the program's installation.) I downloaded the Dependency Walker application, which allows DLL and EXE files to be viewed in a tree-node format, showing file locations, time stamps, and CPU type. A DLL within this tree-view was shown to compile with x86 CPU type. I expanded the file location:

c:\program files (x86)\internet explorer\IESHIMS.DLL

EDIT:

the DLL containing ieshims.dll was built in Labview 2008, which was before Labview was 64-bit compatible (2009 release). There is now an updated version of this DLL available, but I still don't know if it will be 64-bit compatible, or how to make it so. I have access to the DLL to rebuild it if necessary.

If I simply leave the application that is using the DLL as an x86 build, will I run into any issues? Should I create a 64-bit version of the DLL for use?


Solution

  • The solution was to change the Target CPU.