Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: active directory users [modified] Pin
rolandm661023-Jun-09 11:49
rolandm661023-Jun-09 11:49 
QuestionBreakpoint problem Pin
Dan Neely23-Jun-09 10:21
Dan Neely23-Jun-09 10:21 
AnswerRe: Breakpoint problem Pin
EliottA23-Jun-09 10:28
EliottA23-Jun-09 10:28 
GeneralRe: Breakpoint problem Pin
Dan Neely23-Jun-09 10:42
Dan Neely23-Jun-09 10:42 
GeneralRe: Breakpoint problem Pin
EliottA23-Jun-09 10:44
EliottA23-Jun-09 10:44 
GeneralRe: Breakpoint problem Pin
Dan Neely23-Jun-09 10:50
Dan Neely23-Jun-09 10:50 
GeneralRe: Breakpoint problem Pin
EliottA23-Jun-09 10:52
EliottA23-Jun-09 10:52 
AnswerRe: Breakpoint problem Pin
Christian Graus23-Jun-09 10:28
protectorChristian Graus23-Jun-09 10:28 
GeneralRe: Breakpoint problem Pin
Dan Neely23-Jun-09 10:42
Dan Neely23-Jun-09 10:42 
GeneralRe: Breakpoint problem Pin
Christian Graus23-Jun-09 10:52
protectorChristian Graus23-Jun-09 10:52 
GeneralRe: Breakpoint problem Pin
Dan Neely23-Jun-09 11:07
Dan Neely23-Jun-09 11:07 
AnswerRe: Breakpoint problem Pin
Adam Maras23-Jun-09 10:52
Adam Maras23-Jun-09 10:52 
GeneralRe: Breakpoint problem Pin
Dan Neely23-Jun-09 11:09
Dan Neely23-Jun-09 11:09 
QuestionGet value of REG_NONE in registry Pin
jamesband00723-Jun-09 9:27
jamesband00723-Jun-09 9:27 
AnswerRe: Get value of REG_NONE in registry Pin
Luc Pattyn23-Jun-09 9:31
sitebuilderLuc Pattyn23-Jun-09 9:31 
AnswerRe: Get value of REG_NONE in registry Pin
Manas Bhardwaj23-Jun-09 9:31
professionalManas Bhardwaj23-Jun-09 9:31 
QuestionCommunicating with a serial port Pin
12425623-Jun-09 8:55
12425623-Jun-09 8:55 
AnswerRe: Communicating with a serial port Pin
Luc Pattyn23-Jun-09 9:25
sitebuilderLuc Pattyn23-Jun-09 9:25 
Hi,

there are at least two obvious ways to tackle this:

1.
fully event-driven: get things started from the main thread, then perform everything else inside some handler, in your case the SerialPort.DataReceived handler. So what it does is read the line that came in, interpret it, and react to it by performing another SerialPort.Write(), then return.

This is fine for simple cases, it may not suit when more complex interactions are required (e.g. imagine talking and listening to two peripherals, both connected serially)

2.
do not use events such as DataReceived, instead have a separate thread that performs all SerialPort operations, including synchronous (i.e. blocking) Reads. This gives you much more flexibility, you must however use the Control.Invoke pattern in order to touch GUI stuff.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

AnswerRe: Communicating with a serial port Pin
Wes Aday23-Jun-09 9:50
professionalWes Aday23-Jun-09 9:50 
Question.LastIndexOf("%") [modified] Pin
Jasmine Pomelo23-Jun-09 8:26
Jasmine Pomelo23-Jun-09 8:26 
AnswerRe: .LastIndexOf("%") Pin
Luc Pattyn23-Jun-09 8:49
sitebuilderLuc Pattyn23-Jun-09 8:49 
GeneralRe: .LastIndexOf("%") Pin
EliottA23-Jun-09 9:07
EliottA23-Jun-09 9:07 
GeneralRe: .LastIndexOf("%") Pin
Jasmine Pomelo23-Jun-09 9:09
Jasmine Pomelo23-Jun-09 9:09 
GeneralRe: .LastIndexOf("%") Pin
Luc Pattyn23-Jun-09 9:18
sitebuilderLuc Pattyn23-Jun-09 9:18 
Question[Message Deleted] Pin
Gilberto Muñoz23-Jun-09 7:38
Gilberto Muñoz23-Jun-09 7:38 

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.