Click here to Skip to main content
15,886,766 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Overload resolution failed because no accessible 'Add' accepts this number of arguments Pin
Richard MacCutchan9-Apr-14 23:27
mveRichard MacCutchan9-Apr-14 23:27 
GeneralRe: Overload resolution failed because no accessible 'Add' accepts this number of arguments Pin
Ankush Seth9-Apr-14 23:35
Ankush Seth9-Apr-14 23:35 
GeneralRe: Overload resolution failed because no accessible 'Add' accepts this number of arguments Pin
Richard MacCutchan9-Apr-14 23:47
mveRichard MacCutchan9-Apr-14 23:47 
GeneralRe: Overload resolution failed because no accessible 'Add' accepts this number of arguments Pin
Ankush Seth10-Apr-14 0:10
Ankush Seth10-Apr-14 0:10 
QuestionHow do I Rectify the Closure of a Form Pin
Member 107017019-Apr-14 7:01
Member 107017019-Apr-14 7:01 
AnswerRe: How do I Rectify the Closure of a Form Pin
Bernhard Hiller9-Apr-14 22:11
Bernhard Hiller9-Apr-14 22:11 
GeneralRe: How do I Rectify the Closure of a Form Pin
Member 107017019-Apr-14 23:21
Member 107017019-Apr-14 23:21 
AnswerRe: How do I Rectify the Closure of a Form Pin
Alan N10-Apr-14 2:07
Alan N10-Apr-14 2:07 
I would try the following modifications to the DataReceived event handlers

VB
Private Sub SerialPort_DataReceived1(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles sp.DataReceived
        Try
          Dim str1 As String = sp.ReadLine()
          Dim firststr As String = Mid(str1, 1, 4)
          Invoke(myDelegate1, firststr)          
          BeginInvoke(myDelegate1, firststr)
        Catch ioex As IOException
          System.Diagnostics.Debug.Print("IOException {0}", ioex.Message)
        EndTry
    End Sub


If ReadLine is blocked waiting for data then issuing a Close request on the SerialPort will cause an IOException to be thrown with the message "Serial port is Closed". I don't know if that will be causing a problem but the Try.. Catch will let you see what's happening.

Replacing Invoke with BeginInvoke can only do good as it will allow the UI thread to invoke the delegate when it is not busy. If the problem is a deadlock then this change will definitely help.

Alan.
GeneralRe: How do I Rectify the Closure of a Form Pin
Member 1070170110-Apr-14 2:49
Member 1070170110-Apr-14 2:49 
Question[vb2008] Chart from CSV file Pin
Member 107354929-Apr-14 5:40
Member 107354929-Apr-14 5:40 
AnswerRe: [vb2008] Chart from CSV file Pin
Richard MacCutchan9-Apr-14 6:29
mveRichard MacCutchan9-Apr-14 6:29 
AnswerRe: [vb2008] Chart from CSV file Pin
Eddy Vluggen9-Apr-14 6:31
professionalEddy Vluggen9-Apr-14 6:31 
QuestionGetting error 'AddressOf' expression cannot be converted to 'Integer' Pin
Ankush Seth7-Apr-14 23:27
Ankush Seth7-Apr-14 23:27 
AnswerRe: Getting error 'AddressOf' expression cannot be converted to 'Integer' Pin
Richard Deeming8-Apr-14 2:25
mveRichard Deeming8-Apr-14 2:25 
QuestionError : Property is readonly Pin
dilkonika6-Apr-14 8:42
dilkonika6-Apr-14 8:42 
AnswerRe: Error : Property is readonly Pin
Bernhard Hiller6-Apr-14 21:24
Bernhard Hiller6-Apr-14 21:24 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 2:50
dilkonika7-Apr-14 2:50 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen7-Apr-14 7:22
professionalEddy Vluggen7-Apr-14 7:22 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 7:49
dilkonika7-Apr-14 7:49 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen7-Apr-14 8:53
professionalEddy Vluggen7-Apr-14 8:53 
GeneralRe: Error : Property is readonly Pin
dilkonika7-Apr-14 9:44
dilkonika7-Apr-14 9:44 
GeneralRe: Error : Property is readonly Pin
Eddy Vluggen8-Apr-14 8:01
professionalEddy Vluggen8-Apr-14 8:01 
QuestionCalculations Help! Pin
Member 107286676-Apr-14 8:33
Member 107286676-Apr-14 8:33 
AnswerRe: Calculations Help! Pin
Dave Kreskowiak6-Apr-14 8:37
mveDave Kreskowiak6-Apr-14 8:37 
GeneralRe: Calculations Help! Pin
Member 107286676-Apr-14 8:48
Member 107286676-Apr-14 8:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.