Click here to Skip to main content
15,913,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to create function in c# ? Pin
Dave Kreskowiak22-May-09 7:21
mveDave Kreskowiak22-May-09 7:21 
QuestionRe: how to create function in c# ? Pin
harold aptroot22-May-09 7:48
harold aptroot22-May-09 7:48 
QuestionHow to add an event handler for serial port timeout? Pin
thompsons22-May-09 5:37
thompsons22-May-09 5:37 
AnswerRe: How to add an event handler for serial port timeout? Pin
Luc Pattyn22-May-09 5:59
sitebuilderLuc Pattyn22-May-09 5:59 
GeneralRe: How to add an event handler for serial port timeout? Pin
thompsons22-May-09 7:00
thompsons22-May-09 7:00 
GeneralRe: How to add an event handler for serial port timeout? Pin
Dave Kreskowiak22-May-09 7:18
mveDave Kreskowiak22-May-09 7:18 
GeneralRe: How to add an event handler for serial port timeout? Pin
Luc Pattyn22-May-09 7:20
sitebuilderLuc Pattyn22-May-09 7:20 
AnswerRe: How to add an event handler for serial port timeout? Pin
Gideon Engelberth22-May-09 15:25
Gideon Engelberth22-May-09 15:25 
My normal way to do SerialPort uses an AutoResetEvent to do the timeout control. The general format is something like this:

dim port as SerialPort
dim ReceiveResponse as AutoResetEvent

Sub SendCommand(data() as Byte)
  sendTries = 0

  while sendTries <= MaxTries
    sendTries += 1
    port.Write(data)
    if ReceiveResponse.Wait
      'you got a response
    else
      'you didn't get a response in time
    end if
  end while
End Sub

sub PortDataReceivedHandler(sender as object, e as DataReceivedEventArgs)
  if processIncomingData() then
    ReceiveResponse.Set()
  end
end sub


Obviously, this is missing a lot of actual code, but it should point you in the right direction.
GeneralDifference between Menu and MenuStrip, etc Pin
Dan Neely22-May-09 4:14
Dan Neely22-May-09 4:14 
GeneralRe: Difference between Menu and MenuStrip, etc Pin
0x3c022-May-09 4:31
0x3c022-May-09 4:31 
GeneralRe: Difference between Menu and MenuStrip, etc Pin
S. Senthil Kumar22-May-09 4:42
S. Senthil Kumar22-May-09 4:42 
GeneralRe: Difference between Menu and MenuStrip, etc Pin
Dan Neely22-May-09 9:02
Dan Neely22-May-09 9:02 
QuestionWindows Media Player [modified] Pin
gmhanna22-May-09 4:07
gmhanna22-May-09 4:07 
AnswerRe: Windows Media Player Pin
OriginalGriff22-May-09 5:04
mveOriginalGriff22-May-09 5:04 
GeneralRe: Windows Media Player Pin
gmhanna22-May-09 8:18
gmhanna22-May-09 8:18 
GeneralRe: Windows Media Player Pin
OriginalGriff22-May-09 9:26
mveOriginalGriff22-May-09 9:26 
GeneralRe: Windows Media Player Pin
gmhanna22-May-09 10:44
gmhanna22-May-09 10:44 
QuestionEnumerating a class Pin
CodingYoshi22-May-09 3:52
CodingYoshi22-May-09 3:52 
AnswerRe: Enumerating a class Pin
PIEBALDconsult22-May-09 4:24
mvePIEBALDconsult22-May-09 4:24 
GeneralRe: Enumerating a class Pin
CodingYoshi22-May-09 4:44
CodingYoshi22-May-09 4:44 
QuestionComboBox not autoresizing on rebind of datasource Pin
Paul.B22-May-09 3:24
Paul.B22-May-09 3:24 
AnswerRe: ComboBox not autoresizing on rebind of datasource Pin
CodingYoshi22-May-09 3:58
CodingYoshi22-May-09 3:58 
GeneralRe: ComboBox not autoresizing on rebind of datasource Pin
Paul.B22-May-09 5:42
Paul.B22-May-09 5:42 
GeneralRe: ComboBox not autoresizing on rebind of datasource Pin
CodingYoshi22-May-09 8:07
CodingYoshi22-May-09 8:07 
GeneralRe: ComboBox not autoresizing on rebind of datasource Pin
Paul.B25-May-09 22:56
Paul.B25-May-09 22:56 

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.