Attribute VB_Name = "Module1"


Option Explicit

'tipo de variável utilizado pela função GetTabConectados.
Type TTABSOCK
    TabSock(0 To 1023) As Long
    TabIP(0 To 1023) As Long
    NumSockConec As Integer
End Type

'tipo de variável utilizado pela função bMandaConfig.
Type TCCONFIG
    ID As Long
    host(0 To 21) As Byte
    endereco(0 To 21) As Byte
    msknet(0 To 21) As Byte
    texto1(0 To 21) As Byte
    texto2(0 To 21) As Byte
    texto3(0 To 21) As Byte
    texto4(0 To 21) As Byte
    tempoexib As Byte
End Type

'tipo de variável utilizado pela função bMandaUpdConfig.
Type TCUPDCONFIG
    ID As Long
    gateway(0 To 21) As Byte
    nameserver(0 To 21) As Byte
    tcname(0 To 21) As Byte
    updserv(0 To 99) As Byte
    upduser(0 To 21) As Byte
    updpass(0 To 21) As Byte
End Type

'declaração das funções da DLL.
Declare Sub vInitialize Lib "SC501GER.dll" ()
Declare Sub vFinalize Lib "SC501GER.dll" ()
Declare Function iTypeTerm Lib "SC501GER.dll" (ByVal ID As Long) As Long
Declare Sub TermGertecServer Lib "SC501GER.dll" Alias "_TermGertecServer" ()
Declare Function GetTabConectados Lib "SC501GER.dll" (Nada As Integer) As TTABSOCK
Declare Sub TCinet_ntoa Lib "SC501GER.dll" (ByVal nIP As Long, buf As Byte)
Declare Function bReceiveBarcode Lib "SC501GER.dll" (ID As Long, Porta As Long, buffer As Byte, Nbr As Long) As Boolean
Declare Function bSendProdNotFound Lib "SC501GER.dll" (ByVal ID As Long) As Boolean
Declare Function bSendProdPrice Lib "SC501GER.dll" (ByVal ID As Long, NameProd As Byte, PriceProd As Byte) As Boolean
Declare Function bSendDisplayMsg Lib "SC501GER.dll" (ByVal ID As Long, _
                                                Line1 As Byte, _
                                                Line2 As Byte, _
                                                ByVal TimeExhibition As Integer, _
                                                ByVal TypeAnimation As Integer) As Boolean
Declare Function bMandaConfig Lib "SC501GER.dll" (conftemp As TCCONFIG) As Boolean
Declare Function bMandaUpdConfig Lib "SC501GER.dll" (conftemp As TCUPDCONFIG) As Boolean
Declare Function bReceiveConfig Lib "SC501GER.dll" () As TCCONFIG
Declare Function bReceiveUpdConfig Lib "SC501GER.dll" () As TCUPDCONFIG
Declare Function bSendRestartSoft Lib "SC501GER.dll" (ByVal ID As Long) As Boolean
Declare Function bPedeConfig Lib "SC501GER.dll" (ByVal ID As Long) As Long
Declare Function bPedeUpdConfig Lib "SC501GER.dll" (ByVal ID As Long) As Long
Declare Function bSendImageFromFile Lib "SC501GER.dll" (ByVal ID As Long, _
                                                Filename As Byte, _
                                                ByVal width As Long, _
                                                ByVal height As Long, _
                                                ByVal index As Long, _
                                                ByVal looping As Long, _
                                                ByVal pause As Long, _
                                                ByVal resize As Long) As Boolean
Declare Function bSendImagePrice Lib "SC501GER.dll" (ByVal ID As Long, NameProd As Byte, PriceProd As Byte, ByVal Tempo As Long, ByVal width As Long, ByVal height As Long) As Boolean


'function bSendImageFromFile(ID: Integer; filename : array of byte; width, height, index, loop, pause, resize : integer): Boolean; far; external 'SC501GER.dll';

Public Function FileExist(Filename As String) As Boolean

Dim TempAttr As Integer
On Error GoTo ErrorFileExist
TempAttr = GetAttr(Filename)
FileExist = True
GoTo ExitFileExist

ErrorFileExist:
FileExist = False
Resume ExitFileExist
ExitFileExist:
On Error GoTo 0

End Function



