Table of Contents
Barcode DLL reports two kinds of errors: operational errors and encoding errors. They are handled in different ways in Barcode DLL.
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 DLL 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.