To print
Aztec barcode from Visual C++ application, you need Barcodesoft bcsaztec.ttf font and cruflbcs.dll .
If you download and install the demo of Barcodesoft
Aztec font on your
computer, you will find crUFLBCS.dll from
"C:\Program Files (x86)\Common Files\Barcodesoft\Fontutil\" folder.
If you don't find cruflbcs.dll on your computer, please download it from
Aztec Barcode .
crUFLBCS.dll is a COM object with IAztec interface.
You can find detailed information about IAztec interface from readme.html.
To call the method of IAztec interface from VC++, you can use either Late Binding or Early Binding.
Late binding is used when type information of an object is unavailable at compile time.
Early binding requires the client to get access to the type library before compile.
Late Binding
Your codes to generate
Aztec barcode using late binding run slower than using Early Binding.
However, your codes are version-independent as long as COM interface and method parameters remain unchanged.
Early Binding
Your codes to create
Aztec barcode in VC++ application run faster than using Late Binding.
1. Import type library. Don't forget to call
CoInitialize() before using COM interface.
2. If you want to use T2OLE macro to convert
LPTSTR into LPOLESTR, you need to call USES_CONVERSION macro first.
3. You may either call Encode method or EncodeCR method to encode Aztec barcode with options.
#include <atlbase.h>
Use MFC to Generate Wrapper Class
If you use VC++ 6 to create
Aztec barcode, press Ctrl + W to start Class Wizard. Then click "Add Class" button, choose "From a type library".
Choose crUFLBCS.dll, then select IAztec Interface that you want to add wrappers and click OK.
If you use Visual Studio 2003 or above to generate
Aztec barcode,
1. On the Project menu, select Add Class.
2. Select MFC Class from Typelib from the list of templates.
3. For Add Class from, select Registry.
4. In the list of available type libraries, find crUFLBCS.
5. From the list of interfaces in that type library, select all classes for which you want to add wrappers.
6. Click Finish.
Please don't forget to call OleInitialize(NULL) before using the following code snippet to generate
Aztec barcode.
CString strOutput;