OCR SDK Knowledge Base

Article ID: 647 | Category: Programming Aspects | Type: Hot Fix | Last Modified: 6/18/2014

An attempt was made to load a program with an incorrect format

In case the application is run in Visual Studio installed on 64-bit OS with the TargetCPU = “Any CPU” the error message “An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000В)” can occur.

Description

This message can occur the application is run in Visual Studio installed on 64-bit OS with the TargetCPU = “Any CPU”.

Reason

At the moment FineReader Engine works on 64-bit systems in emulation mode (as a 32-bit application).
According to System Requirements (see the Help file → Specifications → System Requirements) there are support of the following 64-bit OS:

• Windows Server 2008 R2
• Windows 7
• Windows Server 2008 SP1-SP2
• Windows Vista SP1-SP2
• Windows Server 2003 SP1-SP2, R2
• Windows XP SP1-SP3

However we would like to note that our products are 32-bit, we do not have a native 64-bit support and that’s why the FREngine library cannot be used in the 64-bit applications. The applications developed with the FREngine are 32-bit and can be launched in emulation mode.

Some information regarding the message is available at http://blogs.msdn.com/b/karthick/archive/2006/02/28/540780.aspx.

Solution

As a solution you can try to explicitly specify TargetCPU = x86 in project settings, if you are ready to make your application forcedly 32-bit. Otherwise the Engine should be load in another way.
For more information please see the Help file → Guided Tour → Advanced Techniques → Programming Aspects → Different Ways to Load Engine.
Info how to change TargetCPU in the Visual Studio can be found in MSDN article.

669 people think this is helpful.
Was this information helpful to you?