Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.

Error: Exception in DLL call - Function OcrInit...Executing OCR calls against Silk Test 15.0 and after.

Error: Exception in DLL call - Function OcrInit...Executing OCR calls against Silk Test 15.0 and after.

Textract OCR and the Classic Agent are both End of Life (EOL) components. OCR has been EOL as of Silk Test 13.0. The reason why this may fail in later versions is related to the compiler. Changes where made to the compiler as required by the Silk development team.

OCR in Silk Test is an End of Life component, and to fix this issue in newer versions would require a full reimplmentation of OCR support. This is known to the Silk Test R&D department and is currently in their backlog.

In the later versions of Silk Test ( such as 15.0 and 15.5) you may encounter the following error when executing OCR tests using the Classic Agent:

Error: Exception in DLL call -- Function OcrInit: code 0xc0000005, flags 0x0, address 0x411c4f4

A workaround for this issue is to use the Open Agent (for the declaration of the window to be OCR'ed as well as for the OCR dll calls). For example, a test against the Windows Calculator, it is sufficient to use a locator based declaration of the Calculator ( just change the declaration in the frame.inc to be locator based on the specific machine). Example:

Instead of....

[-] window MainWin Calculator
[ ] tag "Calculator"

you can use the following....

[-] window MainWin Calculator
[ ] locator "/MainWin[@caption='Calculator']"

The Classic Agent is still set as the default Agent, however when you execute it will use the Open Agent locator for the window.

You will need to add an Application Configuration in the Open Agent for the Calculator by doing the following:

Options >Application Configurations...

Additionallty, in Options > Runtime, add the following line in the 'Use files' field:


For more complex mixed agent scripting you will need to take care that the dll calls are executed against the Open Agent (since 4test automatically routes here as both the Classic and Open Agents can call dll functions).


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2015-04-16 10:05
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.