Barcode Fonts DLL Integration with Windows Presentation Foundation (Visual Basic)

TestFont_VB_WPF is a VB project written in the .NET 3 framework that demonstrates the integration of the ConnectCode dynamic link library. The source code for TestFont_VB_WPF is provided in the download below and requires Visual Studio 2005 or later to compile. The following is a screenshot of the sample in Vista/Windows 7.



Download

Download the TestFont_VB_WPF.zip executable and source code.

The ConnectCode Barcode Fonts DLL and the source for the TestFont_VB_WPF sample are free to use and can be compiled and distributed with users' applications as long as they are being used with any one of the registered barcode font packs. Redistribution of ConnectCode's fonts will, however, require a Distribution or Unlimited Distribution License.

Additional Requirements -

The following needs to be installed on the user's machine for successful compilation and execution.

Steps for integrating the DLL with Windows Presentation Foundation (Visual Basic)


1) Make sure the namespace System.Runtime.InteropServices is imported into your project

Imports System.Runtime.InteropServices

2) Copy the DLLImport statements for connectcodefont.dll into your project.

3) Make calls to the DLL to encode the input data. For example

Dim inputstr As String
Dim outputstr As System.Text.StringBuilder
inputstr = "12345678"
Encode_Code128Auto(inputstr, outputstr, outputstr.Capacity)

The result will be stored in the outputstr variable. 

4) Set the font of the outputstr to the appropriate barcode font. For example, if you are using Encode_Code128Auto, then the font to choose should be CCode128_S3. (If you are developing with the Trial version of ConnectCode Font Pack, the font to choose would be CCCode128_S3_Trial instead)

The TestFont_VB_WPF sample includes all the above steps in a short and easy to understand program.

Note that the barcodes generated with the Trial version of ConnectCode Font Pack will have horizontal lines across them.