LEADTOOLS OCR (Leadtools.Forms.Ocr assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
GetErrorCodeString Method
See Also 
Leadtools.Forms.Ocr Namespace > IOcrEngine Interface : GetErrorCodeString Method



code
engine-specific error code value. This is normally obtained as the Code member when an exception of type OcrException is thrown by this IOcrEngine.

The GetErrorCodeString Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

code
engine-specific error code value. This is normally obtained as the Code member when an exception of type OcrException is thrown by this IOcrEngine.
Gets a string description of an engine-specific error code value.

Syntax

Visual Basic (Declaration) 
Function GetErrorCodeString( _
   ByVal code As Long _
) As String
Visual Basic (Usage)Copy Code
Dim instance As IOcrEngine
Dim code As Long
Dim value As String
 
value = instance.GetErrorCodeString(code)
C# 
string GetErrorCodeString( 
   long code
)
C++/CLI 
String^ GetErrorCodeString( 
   int64 code
) 

Parameters

code
engine-specific error code value. This is normally obtained as the Code member when an exception of type OcrException is thrown by this IOcrEngine.

Return Value

A System.String that contains a short description of the error code value.

Example

This example will cause an error in the engine and then catch and display the error code message

Remarks

When a runtime error occurs in this IOcrEngine, an exception of type OcrException is thrown with the engine-specific error code set in the Code member. This error code is engine-specific but a short description can be obtained using the GetErrorCodeString method.

Logic errors such as invalid parameters to methods or invalid operations throw standard .NET exceptions (in this case, System.ArgumentException and System.InvalidOperationException respectively Errors caused by loading invalid image files using RasterCodecsInstance will throw exceptions of type Leadtools.RasterException. Errors for missing features (support locked) will throw OcrSupportLockedException exceptions. Any other runtime error in the engine will throw an OcrException.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

GetErrorCodeString requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features