When My-program1 and My-program2 are OCRing at the same time on an PC, an Exception occured as below. This is because I want faster OCR performance and 2 same program OCR parrarelly. Surely, My-program1 and My-program2 are same one but different name on them.
What is very strange is that there is no problem when one of them soley OCRs.
---- Occured Exception ----
System.ArgumentNullException: null is not allowed
variable name: ptr
: System.Runtime.InteropServices.Marshal.PtrToStringAnsi(IntPtr ptr, Int32 len)
: Leadtools.Forms.Ocr.Plus.OcrPage.RecognizeText(OcrProgressCallback callback)
: HIRIS_OCR_G1.MainForm._GetOcrCode_folder(Rectangle rect, String gbn, String saupbu, Int32 SaveCnt)
----------------------------------------------------------
this is part of my source code.
------------------------------------------------------------
namespace My-program1
{
public partial class MainForm : Form
{
...........
private string strOCRCode = "";
void _GetOcrCode_folder(Rectangle rect, string gbn, string saupbu, int SaveCnt)
{
......
try
{
...........
strOCRCode = _document.Pages[0].RecognizeText(null); // exception occured !!!!
..............
catch (Exception ex)
{
................
}
}
----------------------------------------
namespace My-program2
{
public partial class MainForm : Form
{
...........
private string strOCRCode = "";
void _GetOcrCode_folder(Rectangle rect, string gbn, string saupbu, int SaveCnt)
{
......
try
{
...........
strOCRCode = _document.Pages[0].RecognizeText(null); // exception occured !!!!
..............
catch (Exception ex)
{
................
}
}
---------------------------------------------------
Leadtool V16 and C# is used.
Thanks in advance.