The encoder ActiveX DLL, MrvDMFEAX3.dll,
also exports a DLL interface to facilitate application
integration with programs supporting only DLL interface.
Note that the strings used in this function are single-byte
ASCII strings. Wide string (Unicode) is not supported.
LONG DllDataMatrixFontEncode(LPCSTR lpszData, /* data to be encoded */
LONG target_size, /* the target size ID */
LPCSTR lpszLineFeedString, /* the line separator string */
LPSTR szOutput, /* the output buffer */
LPDWORD lpdwLen /* the length of the output buffer */
);
- lpszData
-
[in] Pointer to a null-terminated string that specify the data to be encoded. If a partial string has the form \ddd (a back slash followed by three digits), it converts to the character which corresponds to the three digit value. For example, \013 is converted to carriage return (\r). To encode the back slash \, use \\.
For the details on entering advanced features, see Chapter 7, Input format for entering special characters and accessing advanced features.
- Format
[in] The target shape (size) of the DataMatrix symbol. Can be any value between 0 to 30. Value 0 is recommended for this parameter, and the program picks up the most compact size fit for all the data encoded. For a list of values, see Table 1.1, “Data matrix sizes”.
- lpszLineFeedString
[in] A string specifying the line separators. At default it is "\r\n" (carriage return plus line feed). Alter this parameter only if needed.
- szOutput
[out] Pointer to a buffer that receives the barcode string. Must not be NULL.
- lpdwLen
[in, out] Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the szOutput parameter. When the function returns, this variable contains the size of the data copied to szOutput. Note that the size reported does not include the ending NULL character.
- Return Value
Zero if no error is encountered. < 0 if error occurs. For a list of possible errors, see Section 3.5, “Error Handling”.
The code snipet below illustrates the use of the DLL API interface:
Char data[]="MOROVIA"; Char results[1024]; int dwLen = 1024; DllDataMatrixFontEncode(data, 0, "\r\n", results, &dwLen);
The DLL has no dependency on the COM run-time. Consequently the DLL can be placed anywhere in the search path of the application.