3.5. Error Handling

If the DataMatrix Font Encoder determines that there is an format issue in the input string, or the target size is too small to hold the data encoded, it returns an error code in the Encode function. The error code is expressed in COM HRESULT format. A HRESULT is a 32-bit integer containing three parts: severity, facility and error code. If you are using the ActiveX encoder, some programming environments handle the error transparently and displays an error message.

The most common error is that the target size is too small to hold the current data. This error won't appear when you set the target size to 0 (automatic size selection).

Morovia DataMatrix Fontware uses 81 as the facility code.

The Encoder ActiveX / DLL returns the following error codes:

Table 3.2. Error Codes

Value Description
30 The size required is too small to hold the data.
50 A required structural append field is missing. (Data Matrix Structural Append)
51 No control block was found in the message. (Data Matrix Structural Append)
52 Error in the sequence indicator field. Either it is not numeric, or the value is out of range. (Data Matrix Structural Append)
53 Error in the total number of total symbols field. This field can only be a number between 1 and 16. (Data Matrix Structural Append)
54 Invalid file ID. Either it contains invalid characters, or the value is out of range. (Data Matrix Structural Append)
60 Error in the specified ECI. Either it contains invalid characters, or the value is out of range. (Data Matrix ECI)
70 Macro 05 or Macro 06 should appear at the first position of the input and should not be used in conjunction with structural append. (Data Matrix Macro)
71 Reader programming ~3 should appear at the first position of the input and should not be used in conjunction with structural append. (Data Matrix Reader Programming)