Click here to Skip to main content
15,883,840 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: convert from php to c# Pin
Ennis Ray Lynch, Jr.23-Jun-09 7:59
Ennis Ray Lynch, Jr.23-Jun-09 7:59 
AnswerRe: convert from php to c# Pin
EliottA23-Jun-09 9:00
EliottA23-Jun-09 9:00 
AnswerRe: [Message Deleted] Pin
EliottA23-Jun-09 9:13
EliottA23-Jun-09 9:13 
Questionhow can i get data from SQL northwind.sdf into the textBox ????????? need help Pin
dimo198223-Jun-09 7:37
dimo198223-Jun-09 7:37 
AnswerRe: how can i get data from SQL northwind.sdf into the textBox ????????? need help Pin
dan!sh 23-Jun-09 8:02
professional dan!sh 23-Jun-09 8:02 
GeneralRe: how can i get data from SQL northwind.sdf into the textBox ????????? need help Pin
dimo198223-Jun-09 8:37
dimo198223-Jun-09 8:37 
GeneralRe: how can i get data from SQL northwind.sdf into the textBox ????????? need help Pin
Eddy Vluggen23-Jun-09 9:23
professionalEddy Vluggen23-Jun-09 9:23 
AnswerRe: how can i get data from SQL northwind.sdf into the textBox ????????? need help Pin
EliottA23-Jun-09 9:03
EliottA23-Jun-09 9:03 
GeneralRe: how can i get data from SQL northwind.sdf into the textBox ????????? need help Pin
dimo198223-Jun-09 13:03
dimo198223-Jun-09 13:03 
QuestionGetting the last line in a string Pin
Jasmine Pomelo23-Jun-09 6:56
Jasmine Pomelo23-Jun-09 6: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.