Chapter 13. Error Handling

Table of Contents

13.1. Error Codes

Barcode ActiveX reports two kinds of errors: operational errors and encoding errors. They are handled in different ways in Barcode ActiveX.

Operational errors occur when an operation fails or a property is set to an invalid value. The error is reported through the return code of the function. Your program can then retrieve the error message through GetLastBarcodeError function.

You can tell if the function operates as expected by comparing the return code with zero. If the return code is a negative number, the operation fails.

For performance reasons Barcode ActiveX does not attempt to encode every time that a property changes, especially for two dimensional symbologies. There is no fixed algorithm to tell whether the size specified can hold the data until the program encodes with all the properties specified. The encoding errors are reported at the time of the actual rendering. An image containing the error codes and messages is rendered in the place of the barcode, as the image below illustrates:

The error message tells that the size specified is too small to hold the data encoded. It also tells you in order to encode the current data, the minimum size ID is 11 (mbxDMTargetSize_40X40). Normally you handle encoding errors at design time by modifying the properties.

13.1. Error Codes

Operational Error codes specific to Barcode ActiveX are listed below:

Table 13.1. Error Codes (Operational)

ValueDescription
6101This symbology is not supported by the current version of Morovia Barcode ActiveX.
6102The message is either empty or contains invalid character for the chosen symbology.
6103The measurement unit must be either English (0) or Metric (1).
6104The Zoom Ratio should ranged between 0.1 and 100
6105The NarrowToWideRatio should be between 2.0 and 3.0
6107Failed to overwrite file or create the new file. It may be caused by insufficient privilege or disk is full.
6108Invalid Raster Image Resolution. The resolution must be greater than 50.
6109The label size you specified is invalid, or you can not edit the size under the current mode.
6112The current symbology required fixed length. The length you specified does not meet this requirement.
6113The message string contains characters that can not be encoded under the current symbology.
6114The object can not be loaded from the media specified. See Error Log for details.
6115The object failed to save itself to the specified media.
6116Invalid value for BarHeight property.
6117The MaxicodeZipCode property must consist a valid zip code with up to 6 alpha-numeric characters.
6118The MaxicodeCountryCode must between 000 and 999
6119The value range for MaxicodeMode must be between 2 and 6.
6120The value range for MaxicodeClass must be between 000 and 999.
6121Error happens during the PDF417 encoding process. For more information retrieve the Error object.
6122Can not generate bitmap handle. Possible reasons include insufficient memory, too big size of the bitmap etc.

Table 13.2. Error Codes (Encoding)

ValueDescription
10The AI portion of an EAN-128 structure must be numeric. (EAN-128)
11The data portion of the EAN-128 data must be alpha-numeric. (EAN-128)
12Invalid UCC/EAN-128 structure. Check whether the AI and field ID are enclosed with parenthesis. (EAN-128)
13The length of the data portion of the EAN-128 is incorrect. (EAN-128)
14Based on the AI, the data portion must be numeric. However, this is not the case in the message encoded. (EAN-128)
20No control block was found in the message. (PDF417)
21Invalid Raster Image Resolution. The resolution must be greater than 50.
22Error in the segment index. Either the segment index is not numeric, or the index is bigger than the total segment count. (PDF417)
23Error in total segment count field. (PDF417)
24Incorrect MacroPDF417 optional field format. (PDF417)
30The size required is too small to hold the data. (PDF417, Data Matrix)
40GLI must be 6 digits in the range between 0 and 811,799. (PDF417)
41The security level is too high to encode all the data. (PDF417)
50A required structural append field is missing. (Data Matrix Structural Append)
51No control block was found in the message. (Data Matrix Structural Append)
52Error in the sequence indicator field. Either it is not numeric, or the value is out of range. (Data Matrix Structural Append)
53Error in the total number of total symbols field. This field can only be a number between 1 and 16. (Data Matrix Structural Append)
54Invalid file ID. Either it contains invalid characters, or the value is out of range. (Data Matrix Structural Append)
60Error in the specified ECI. Either it contains invalid characters, or the value is out of range. (Data Matrix ECI)
70Macro 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)
71Reader 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)
200Carrier message prefix detected but not all required fields are present. (MaxiCode)