ben voilà je n'arrive pas a compiler, mon application il me colle une erreur à la compilation et je ne comprend pas du tout ou est le problème. en gros je sèche.
Erreur pour le paramètre 'e' de 'Private Sub tmrReadCommPort2_Tick(sender As Object, e As System.EventArgs)'.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As String a = "TT,12" & Chr(13) ' Try to get info from the Comm Port. Try Me.tmrReadCommPort2_Tick.Enable = True m_CommPort.Open(1, 19200, 8, Rs232.DataParity.Parity_None, Rs232.DataStopBit.StopBit_1, 4096) m_CommPort.Write(Encoding.ASCII.GetBytes(a)) ' Try to read a single byte. If you get it, then assume ' that the port contains a modem. Clear the buffer before ' leaving. System.Threading.Thread.Sleep(200) Application.DoEvents() m_CommPort.Close() Catch exc As Exception ' Nothing to read from the Comm Port, so set to False MessageBox.Show(" impossible de communiquer" ) Finally Me.tmrReadCommPort2_Tick.enable = False End Try End Sub
Private Sub tmrReadCommPort2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrReadCommPort2.Tick Try While (m_CommPort.Read(1) <> -1) WriteMessage(Chr(m_CommPort.InputStream(0)), False) End While Catch exc As Exception End Try
End Sub
Message édité par bossamiral2 le 16-04-2003 à 20:28:21
Marsh Posté le 16-04-2003 à 00:38:41
ben voilà je n'arrive pas a compiler, mon application il me colle une erreur à la compilation et je ne comprend pas du tout ou est le problème. en gros je sèche.
Erreur pour le paramètre 'e' de 'Private Sub tmrReadCommPort2_Tick(sender As Object, e As System.EventArgs)'.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As String
a = "TT,12" & Chr(13)
' Try to get info from the Comm Port.
Try
Me.tmrReadCommPort2_Tick.Enable = True
m_CommPort.Open(1, 19200, 8, Rs232.DataParity.Parity_None, Rs232.DataStopBit.StopBit_1, 4096)
m_CommPort.Write(Encoding.ASCII.GetBytes(a))
' Try to read a single byte. If you get it, then assume
' that the port contains a modem. Clear the buffer before
' leaving.
System.Threading.Thread.Sleep(200)
Application.DoEvents()
m_CommPort.Close()
Catch exc As Exception
' Nothing to read from the Comm Port, so set to False
MessageBox.Show(" impossible de communiquer" )
Finally
Me.tmrReadCommPort2_Tick.enable = False
End Try
End Sub
Private Sub tmrReadCommPort2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrReadCommPort2.Tick
Try
While (m_CommPort.Read(1) <> -1)
WriteMessage(Chr(m_CommPort.InputStream(0)), False)
End While
Catch exc As Exception
End Try
End Sub
Message édité par bossamiral2 le 16-04-2003 à 20:28:21