ok grazie della risposta, allora dove dovrei spostare la discussione?
Questo è il codice che effettua quando chiama la sub NewTX:
Private Sub NewTX(txtString As String)
' trasmette una stringa (txtString) sulla porta seriale, dopo
' averla impacchettata in un buffer di byte
Dim BytesToBeSent As Long
Dim SentBytes As Long
Dim Buffer() As Byte
Dim i As Long
Dim fSuccess As Integer
Dim ferror As Integer
If txtString = "" Then Exit Sub
BytesToBeSent = Len(txtString)
ReDim Buffer(1 To BytesToBeSent)
For i = 1 To BytesToBeSent
Buffer(i) = Asc(Mid(txtString, i, 1))
Next i
' scrive sulla porta seriale; in particolare, imposta a 0 (NULL)
' l'ultimo parametro della WriteFile, poiche' la comunicazione
' sara' sincrona (non overlapped)
fSuccess = WriteFile(hCom, Buffer(1), BytesToBeSent, SentBytes, 0)
If fSuccess = 0 Then MsgBox "Errore in Tx"
If (fSuccess <> 0) And (SentBytes = BytesToBeSent) Then
FlushFileBuffers (hCom)
Else
ferror = Err.LastDllError
' gestione errore
End If
End Sub

