If value <> m_BaudRate Then
If Not Me.DesignMode Then
'* If a new instance needs to be created, such as a different Com Port
CreateDLLInstance()
If DLL(MyDLLInstance) IsNot Nothing Then
DLL(MyDLLInstance).CloseComms()
Try
DLL(MyDLLInstance).BaudRate = value
Catch ex As Exception
'* 0 means AUTO to the data link layer
DLL(MyDLLInstance).BaudRate = 0
End Try
End If
End If
m_BaudRate = value
End If
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in beta 319
lines 103 - 105
If value <> m_BaudRate Then
If DLL IsNot Nothing Then
DLL(MyDLLInstance).CloseComms()
Shouldn't line 104 be:
If DLL(MyDLLInstance) IsNot Nothing Then
Otherwise it crashes if you change the baud rate value.
Just started looking at the program, looks nice so far.
I noticed the bug in "DF1comm.vb" was not fixed in the new 321 release.
If I do not modify the source code as I mentioned, any compiled programs will crash on launching in set_BaudRate() if it is not set to AUTO.
Thanks
This fix was missed in 3.21
I changed the code to this:
If value <> m_BaudRate Then
If Not Me.DesignMode Then
'* If a new instance needs to be created, such as a different Com Port
CreateDLLInstance()
If DLL(MyDLLInstance) IsNot Nothing Then
DLL(MyDLLInstance).CloseComms()
Try
DLL(MyDLLInstance).BaudRate = value
Catch ex As Exception
'* 0 means AUTO to the data link layer
DLL(MyDLLInstance).BaudRate = 0
End Try
End If
End If
m_BaudRate = value
End If