
Option Strict Off
Option Explicit On 
Imports System.Runtime.InteropServices
Module Module1

    Structure MojString
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public T() As Byte
    End Structure

    'Structure MojString
    '    <VBFixedArray(256)> Dim T() As Byte

    'UPGRADE_TODO: "Initialize" must be called to initialize instances of this structure. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1026"'
    Public Sub Initialize()
        'UPGRADE_WARNING: Lower bound of array T was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1033"'
        'ReDim T(256)
    End Sub

    Public Sub StringNaMojString(ByVal InString As String, ByRef OutString As MojString)

        Dim Licznik As Integer

        For Licznik = 0 To Len(InString) - 1
            OutString.T(Licznik) = Asc(Mid(InString, Licznik + 1, 1))
        Next Licznik
        OutString.T(Len(InString)) = 0

    End Sub
    Public Sub MojStringNaString(ByRef InString As MojString, ByRef OutString As String)

        Dim Licznik As Integer

        Licznik = 0
        OutString = ""

        While (Licznik < 255) And (InString.T(Licznik) > 0)
            OutString = OutString & Chr(InString.T(Licznik))
            Licznik = Licznik + 1
        End While

    End Sub
    Public Class ObslugaSprawdzarekClass
        Public Delegate Sub XFunkcjaObslugiBarkodow(ByRef AdresIP As MojString, ByRef Barkod As MojString, ByRef TekstNaWyswietlacz As MojString, ByRef RodzajDzwieku As Integer, ByRef CzasWyswietlania As Integer, ByRef TekstDoDrukarki As MojString)
        Public Sub FunkcjaObslugiBarkodow(ByRef AdresIP As MojString, ByRef Barkod As MojString, ByRef TekstNaWyswietlacz As MojString, ByRef RodzajDzwieku As Integer, ByRef CzasWyswietlania As Integer, ByRef TekstDoDrukarki As MojString)
            CzasWyswietlania = 5
            RodzajDzwieku = 0
            Dim Tmp As String

            Tmp = ""
            Call MojStringNaString(Barkod, Tmp)
            Call StringNaMojString("INFORMACJA ZWROTNA" & Chr(10) & Tmp & Chr(10), TekstNaWyswietlacz)
            Call StringNaMojString("", TekstDoDrukarki)
        End Sub
        Public Delegate Function XFunkcjaObslugiStatusow(ByRef AdresIP As MojString, ByVal TypWyswietlacza As Integer, ByVal TypDrukarki As Integer, ByVal Status As Integer, ByRef Wersja As MojString) As Integer
        Public Function FunkcjaObslugiStatusow(ByRef AdresIP As MojString, ByVal TypWyswietlacza As Integer, ByVal TypDrukarki As Integer, ByVal Status As Integer, ByRef Wersja As MojString) As Integer
            Dim Tmp As String

            Tmp = ""
            Call MojStringNaString(Wersja, Tmp)
            MsgBox(Tmp)
        End Function
        Public Delegate Sub XFunkcjaObslugiBledow(ByRef AdresIP As MojString, ByVal TypTransmisji As Integer, ByVal NumerBledu As Integer, ByRef OpisBledu As MojString)
        Public Sub FunkcjaObslugiBledow(ByRef AdresIP As MojString, ByVal TypTransmisji As Integer, ByVal NumerBledu As Integer, ByRef OpisBledu As MojString)
            Dim Tmp As String

            Tmp = ""
            Call MojStringNaString(OpisBledu, Tmp)
            MsgBox(Tmp)
        End Sub
    End Class
End Module