It is necessary to insert a barcode into the template in CrystalReports. I'm new to Visual Studio and vb. I wrote ufl (code below), in which I use the generator from here https://www.codeproject.com/Articles/20823/Barcode-Image-Generation-Library . The generator takes a string and returns an object of type System.Drawing.Image. I try to insert it directly into the pattern, but when I create the document, the "access violation" exception crashes.

Imports System.Runtime.InteropServices

<ComVisible(True), ClassInterface(ClassInterfaceType.None), GuidAttribute("F5DCE88F-AD38-4a9a-9A69-0F8DC0EDB4E3")> Public Class ExchangeUfl : Implements IExchangeUfl Dim barcode As New BarcodeLib.Barcode Public Function ConvertToGS1Barcode(data As String) As Drawing.Image Implements IExchangeUfl.ConvertToGS1Barcode Return barcode.DoEncode(BarcodeLib.TYPE.CODE128, data) End Function End Class 

    0