7.2. Create a Barcode Object

A barcode object is created through function CreateBarcodeObject, which has the following prototype:

HANDLE CreateBarcodeObject(const char* lpszLicenseTo, 
                                 const char* lpszRegCode);

The CreateBarcodeObject function creates a barcode object using default properties and returns a number that uniquely identifies the object (handle). Through the handle, the client application modifies the object properties, persists the object to a disk file, and retrieves barcode rendering in a variety of image formats.

Two string parameters are required for the function. At the time when you place the order, we assign the LicenseTo and Registration code to you when the order is completed. You should keep the registration code in a safe place and use them only in the source code. Putting the registration code visible to your user, such as a plain text file, is not allowed.

The function will always succeed unless the program does not have sufficient memory. Therefore the return value does not tell you if the license paratmeters are correct. Instead the object enters the DEMO mode. Under the demo mode, the barcode image exported has a “DEMO” watermark.

The application can query if the barcode object is under the demo mode by calling function IsBarcodeObjectDemo. If the function returns a non-zero value, the barcode object is under demo mode and every barcode image exported carries a “DEMO” watermark.