Table of Contents
Morovia QRCode Fontware & Writer SDK provides two distinct approaches when integrating with your application - a Windows encoder DLL and an image-based ActiveX. Depending on your programming environment, you may find one way easier than the other.
The software supports RGB color space, with each component expressed in a byte. Windows programmers often deal with two types of color values: COLORREF and OLE_COLOR. The first type uses a 32-bit integer with the leading byte always empty. The second one use the most significant bit to indicate whether it is a system color and conversion is required. The two color types use the lower three bytes for B, G and R components respectively - note that the Red component is in the last byte.
Other platforms typically place the component values in the order of Red, Green and Blue. We adopts this format in our DLL interface. Therefore, the value of 0xff0000 indicates red color in our DLL, but blue to Windows if no translation is performed.
In QRCodeActiveX control, the color is
represented as OLE_COLOR
format, therefore no translation
is required.
In DLL and ActiveX Control, you can specify the size desired by setting a value to Version. If the value is 0, the program chooses the value that produces the smallest barcode possible. If the value specified is too small to encode all the data, the program increases the value automatically.
Error may occur during encoding process - for example, the data may exceed the maximum capacity allowed, and malformed structural append block or Kanji block may exist in the input. QRCode ActiveX control and encoder DLL return error code in COM-compliant way - with this code consisting of any information such as facility code.
Table 7.1. Error Codes
Value | HRESULT | Description |
---|---|---|
5 | 0x83290005 | Input is too long |
6 | 0x83290006 | Invalid characters in input data |
9 | 0x83290009 | Encoding problem. Try run again |
10 | 0x8329000a | File access denied |
11 | 0x8329000b | Out of memory |
12 | 0x8329000c | Output buffer size is too small |
30 | 0x832901e | Invalid length string |
50 | 0x83290032 | Missing field in Structural Append block |
52 | 0x83290034 | Invalid Sequence in Structural Append block |
53 | 0x83290035 | Invalid TotalNum in Structural Append block |
80 | 0x83290050 | Invalid Kanji block |
81 | 0x83290051 | Invalid FNC1 second position block |
DLL client can call exported function QRCodeGetErrorMessage
to retrieve a text description on the error message.
COM client can retrieves IErrorInfo
interface to
the Error object, following the standard COM error protocol.
the file name of this dll is MoroviaQRCodeFontEncoder.dll
,
installed by default in the system directory c:\windows\system32
. The Encoder GUI
and Word AddIn calls this dll at the background for encoding.
Using DLL is convenient in many occasions because you do not need to register it. Instead it, just place the dll under the same directory as you exe.
Writing a client application that creates and manipulates COM objects is quite straightforward and supported in many programming environments. We have included coding examples in C++, C# and Visual Basic 6. Investigate the examples we provided if you decide to use this approach.