Recoginition Engine Halted with code0 in Visual Studio

Jul 5, 2011 at 8:31 AM


I'm running the sample application using Visual Studio 2010 on Windows 7 Professionl 64bit.

When I load and image and click the recognise button, the following exception is raised on puma.Page.RecognizeToFile(imageViewer.FileName);

   at Puma.Net.PumaPage.RecognizeToFile(String fileName, PumaFileFormat format)
   at Puma.Net.PumaPage.RecognizeToFile(String fileName)
   at Puma.Net.Sample.MainForm.recognizeButton_Click(Object sender, EventArgs e) in G:\Puma.NET\Sample\MainForm.cs:line 94
   at Puma.Net.Sample.ImageViewer.recognizeButton_Click(Object sender, EventArgs e) in G:\Puma.NET\Sample\ImageViewer.cs:line 217
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Puma.Net.Sample.Program.Main() in G:\Puma.NET\Sample\Program.cs:line 41
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

After copying dibapi.dll to my Windows/WOW64 area, setting permissions on the "COM Server" directory and targetting the x86 platform I can get the sample to run outside of VS, but not when debugging in VS.


Oct 27, 2011 at 7:44 PM

Hi mad_bollie,

Did you solve the problem? I'm having the same trouble and I have no idea what to do.

I'll apreciate if you can help me.

Regards and thx in advance




Oct 28, 2011 at 1:29 AM

I have not solved this problem. I don't know the reason.

Nov 4, 2011 at 7:44 AM
Edited Nov 4, 2011 at 7:47 AM

I've created a simple test program in VS2008 on Windows 7 and it keeps triggering "Recoginition Engine Halted with code0 exception

string Filepath = "D:\\eight\\Pictures\\ToOCR.tif";

var pumaPage = new PumaPage(Filepath);
pumaPage.FileFormat = PumaFileFormat.RtfTxtAnsi;
pumaPage.EnableSpeller = false;
pumaPage.Language = PumaLanguage.English;
pumaPage.RecognizeToFile(Filepath + ".txt");

I manually restart VS2008 via right click > "Run as administrator", open the project. The project compiles and runs correctly and generated "ToOCR.tif.txt" with the ocr result inside without triggering exception. It seems like using requires me to always "run as administrator" on Windows 7. Is there any way around this?

Nov 11, 2011 at 7:33 AM


I finally get some acces to the functionallity, setting permissions to the "Com Server" directory, as said mad_bollie on the bottom

Anyway, I notice that is important to have the text "darker" than the "leaf color". I don't know if it is clear, the text should be darker than the bottom

I don't know if it will help you


Dec 7, 2011 at 9:21 PM

I have some got it to work in VS2010 by adding the Puma.NET source as a project in my solution and referencing it. It still needs to be an admin when it runs though.